diff --git a/packages/data/src/redux-store/metadata/actions.js b/packages/data/src/redux-store/metadata/actions.js index 0dc70aa800366e..adfe0f6918f753 100644 --- a/packages/data/src/redux-store/metadata/actions.js +++ b/packages/data/src/redux-store/metadata/actions.js @@ -2,10 +2,10 @@ * Returns an action object used in signalling that selector resolution has * started. * - * @param {string} selectorName Name of selector for which resolver triggered. - * @param {...*} args Arguments to associate for uniqueness. + * @param {string} selectorName Name of selector for which resolver triggered. + * @param {unknown[]} args Arguments to associate for uniqueness. * - * @return {Object} Action object. + * @return {{ type: 'START_RESOLUTION', selectorName: string, args: unknown[] }} Action object. */ export function startResolution( selectorName, args ) { return { @@ -19,10 +19,10 @@ export function startResolution( selectorName, args ) { * Returns an action object used in signalling that selector resolution has * completed. * - * @param {string} selectorName Name of selector for which resolver triggered. - * @param {...*} args Arguments to associate for uniqueness. + * @param {string} selectorName Name of selector for which resolver triggered. + * @param {unknown[]} args Arguments to associate for uniqueness. * - * @return {Object} Action object. + * @return {{ type: 'FINISH_RESOLUTION', selectorName: string, args: unknown[] }} Action object. */ export function finishResolution( selectorName, args ) { return { @@ -36,11 +36,11 @@ export function finishResolution( selectorName, args ) { * Returns an action object used in signalling that a batch of selector resolutions has * started. * - * @param {string} selectorName Name of selector for which resolver triggered. - * @param {...*} args Array of arguments to associate for uniqueness, each item - * is associated to a resolution. + * @param {string} selectorName Name of selector for which resolver triggered. + * @param {unknown[]} args Array of arguments to associate for uniqueness, each item + * is associated to a resolution. * - * @return {Object} Action object. + * @return {{ type: 'START_RESOLUTIONS', selectorName: string, args: unknown[] }} Action object. */ export function startResolutions( selectorName, args ) { return { @@ -54,11 +54,11 @@ export function startResolutions( selectorName, args ) { * Returns an action object used in signalling that a batch of selector resolutions has * completed. * - * @param {string} selectorName Name of selector for which resolver triggered. - * @param {...*} args Array of arguments to associate for uniqueness, each item - * is associated to a resolution. + * @param {string} selectorName Name of selector for which resolver triggered. + * @param {unknown[]} args Array of arguments to associate for uniqueness, each item + * is associated to a resolution. * - * @return {Object} Action object. + * @return {{ type: 'FINISH_RESOLUTIONS', selectorName: string, args: unknown[] }} Action object. */ export function finishResolutions( selectorName, args ) { return { @@ -71,10 +71,10 @@ export function finishResolutions( selectorName, args ) { /** * Returns an action object used in signalling that we should invalidate the resolution cache. * - * @param {string} selectorName Name of selector for which resolver should be invalidated. - * @param {Array} args Arguments to associate for uniqueness. + * @param {string} selectorName Name of selector for which resolver should be invalidated. + * @param {unknown[]} args Arguments to associate for uniqueness. * - * @return {Object} Action object. + * @return {{ type: 'INVALIDATE_RESOLUTION', selectorName: string, args: any[] }} Action object. */ export function invalidateResolution( selectorName, args ) { return { @@ -88,7 +88,7 @@ export function invalidateResolution( selectorName, args ) { * Returns an action object used in signalling that the resolution * should be invalidated. * - * @return {Object} Action object. + * @return {{ type: 'INVALIDATE_RESOLUTION_FOR_STORE' }} Action object. */ export function invalidateResolutionForStore() { return { @@ -103,7 +103,7 @@ export function invalidateResolutionForStore() { * @param {string} selectorName Name of selector for which all resolvers should * be invalidated. * - * @return {Object} Action object. + * @return {{ type: 'INVALIDATE_RESOLUTION_FOR_STORE_SELECTOR', selectorName: string }} Action object. */ export function invalidateResolutionForStoreSelector( selectorName ) { return { diff --git a/packages/data/tsconfig.json b/packages/data/tsconfig.json new file mode 100644 index 00000000000000..574fdc56223364 --- /dev/null +++ b/packages/data/tsconfig.json @@ -0,0 +1,20 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "rootDir": "src", + "declarationDir": "build-types", + "noUnusedParameters": false, + }, + "references": [ + { "path": "../compose" }, + { "path": "../deprecated" }, + { "path": "../element" }, + { "path": "../is-shallow-equal" }, + { "path": "../priority-queue" }, + // Needs to be added once it is typed + // { "path": "../redux-routine" } + ], + "include": [ + "src/redux-store/metadata/actions.js" + ] +} diff --git a/tsconfig.json b/tsconfig.json index f1fa8250ee0bf5..53ab6c77aa41b5 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,6 +8,7 @@ { "path": "packages/block-editor" }, { "path": "packages/components" }, { "path": "packages/compose" }, + { "path": "packages/data" }, { "path": "packages/date" }, { "path": "packages/deprecated" }, { "path": "packages/docgen" },