Skip to content

Commit

Permalink
Preferences: Remove types field from package.json (#49053)
Browse files Browse the repository at this point in the history
* Preferences: Remove `types` field from `package.json`

The preferences package does not actually provide any TypeScript types, nor is it written in TypeScript. Adding a `types` field incorrectly declares the opposite.

* Fix typing for persistence layer set function

---------

Co-authored-by: Daniel Richards <[email protected]>
  • Loading branch information
swissspidy and talldan authored Mar 15, 2023
1 parent 987f80b commit 170076a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion packages/preferences/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"main": "build/index.js",
"module": "build-module/index.js",
"react-native": "src/index",
"types": "build-types",
"sideEffects": false,
"dependencies": {
"@babel/runtime": "^7.16.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/preferences/src/store/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ export function setDefaults( scope, defaults ) {
}

/** @typedef {() => Promise<Object>} WPPreferencesPersistenceLayerGet */
/** @typedef {(*) => void} WPPreferencesPersistenceLayerSet */
/** @typedef {(Object) => void} WPPreferencesPersistenceLayerSet */
/**
* @typedef WPPreferencesPersistenceLayer
*
* @property {WPPreferencesPersistenceLayerGet} get An async function that gets data from the persistence layer.
* @property {WPPreferencesPersistenceLayerSet} set A function that sets data in the persistence layer.
* @property {WPPreferencesPersistenceLayerSet} set A function that sets data in the persistence layer.
*/

/**
Expand Down

1 comment on commit 170076a

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in 170076a.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4423191014
📝 Reported issues:

Please sign in to comment.