diff --git a/docs/reference-guides/data/data-core-notices.md b/docs/reference-guides/data/data-core-notices.md index 23b31a3cf011af..c5e3bc017a9146 100644 --- a/docs/reference-guides/data/data-core-notices.md +++ b/docs/reference-guides/data/data-core-notices.md @@ -156,7 +156,7 @@ const ExampleComponent = () => { _Parameters_ -- _status_ `[string]`: Notice status. +- _status_ `string|undefined`: Notice status ("info" if undefined is passed). - _content_ `string`: Notice message. - _options_ `[Object]`: Notice options. - _options.context_ `[string]`: Context under which to group notice. diff --git a/packages/block-editor/tsconfig.json b/packages/block-editor/tsconfig.json index 7841d4fef27409..6778b6cfdd4d61 100644 --- a/packages/block-editor/tsconfig.json +++ b/packages/block-editor/tsconfig.json @@ -23,6 +23,7 @@ { "path": "../icons" }, { "path": "../is-shallow-equal" }, { "path": "../keycodes" }, + { "path": "../notices" }, { "path": "../style-engine" }, { "path": "../token-list" }, { "path": "../url" }, diff --git a/packages/block-library/tsconfig.json b/packages/block-library/tsconfig.json index cb70d96e7c3f83..5113bb96e9e5e7 100644 --- a/packages/block-library/tsconfig.json +++ b/packages/block-library/tsconfig.json @@ -26,6 +26,7 @@ { "path": "../html-entities" }, { "path": "../i18n" }, { "path": "../icons" }, + { "path": "../notices" }, { "path": "../keycodes" }, { "path": "../primitives" }, { "path": "../url" }, diff --git a/packages/notices/CHANGELOG.md b/packages/notices/CHANGELOG.md index e6d65ee1c079ac..18dfa406f64743 100644 --- a/packages/notices/CHANGELOG.md +++ b/packages/notices/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +### Breaking Change + +- Publish Typescript build types to npm. ([#49650](https://github.com/WordPress/gutenberg/pull/49650)) + ## 3.31.0 (2023-04-12) ## 3.30.0 (2023-03-29) diff --git a/packages/notices/package.json b/packages/notices/package.json index c7a5e29948acfd..48673134370556 100644 --- a/packages/notices/package.json +++ b/packages/notices/package.json @@ -24,6 +24,7 @@ "main": "build/index.js", "module": "build-module/index.js", "react-native": "src/index", + "types": "build-types", "dependencies": { "@babel/runtime": "^7.16.0", "@wordpress/a11y": "file:../a11y", diff --git a/packages/notices/src/store/actions.js b/packages/notices/src/store/actions.js index 1fbc1b2f0dac0a..a8fdb13f9352fc 100644 --- a/packages/notices/src/store/actions.js +++ b/packages/notices/src/store/actions.js @@ -19,7 +19,7 @@ let uniqueId = 0; /** * Returns an action object used in signalling that a notice is to be created. * - * @param {string} [status='info'] Notice status. + * @param {string|undefined} status Notice status ("info" if undefined is passed). * @param {string} content Notice message. * @param {Object} [options] Notice options. * @param {string} [options.context='global'] Context under which to diff --git a/packages/notices/src/store/index.js b/packages/notices/src/store/index.js index 49fa74e0eca6bc..cab1b3186dfc7c 100644 --- a/packages/notices/src/store/index.js +++ b/packages/notices/src/store/index.js @@ -14,8 +14,6 @@ import * as selectors from './selectors'; * Store definition for the notices namespace. * * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore - * - * @type {Object} */ export const store = createReduxStore( 'core/notices', { reducer, diff --git a/packages/notices/tsconfig.json b/packages/notices/tsconfig.json new file mode 100644 index 00000000000000..561bf355a1b555 --- /dev/null +++ b/packages/notices/tsconfig.json @@ -0,0 +1,11 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "rootDir": "src", + "declarationDir": "build-types", + "types": [ "gutenberg-env" ], + "checkJs": false + }, + "references": [ { "path": "../a11y" }, { "path": "../data" } ], + "include": [ "src/**/*" ] +} diff --git a/tsconfig.json b/tsconfig.json index 2d37bcf2b45a76..d933bc14c84e4f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -30,6 +30,7 @@ { "path": "packages/is-shallow-equal" }, { "path": "packages/keycodes" }, { "path": "packages/lazy-import" }, + { "path": "packages/notices" }, { "path": "packages/plugins" }, { "path": "packages/prettier-config" }, { "path": "packages/primitives" },