Skip to content

Commit

Permalink
Add tsconfig.json to core-data package (#43638)
Browse files Browse the repository at this point in the history
* Add tsconfig.json to core-data package
* Lint
  • Loading branch information
adamziel authored Aug 26, 2022
1 parent 68a9ff1 commit 5d31bfa
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/core-data/src/selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import type * as ET from './entity-types';
// It makes the selectors slightly more safe, but is intended to evolve
// into a more detailed representation over time.
// See https://github.com/WordPress/gutenberg/pull/40025#discussion_r865410589 for more context.
interface State {
export interface State {
autosaves: Record< string | number, Array< unknown > >;
blockPatterns: Array< unknown >;
blockPatternCategories: Array< unknown >;
Expand Down
21 changes: 21 additions & 0 deletions packages/core-data/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"rootDir": "src",
"declarationDir": "build-types",
"noUnusedParameters": false,
"checkJs": false,
"noImplicitAny": false
},
"references": [
{ "path": "../api-fetch" },
{ "path": "../data" },
{ "path": "../deprecated" },
{ "path": "../element" },
{ "path": "../html-entities" },
{ "path": "../i18n" },
{ "path": "../is-shallow-equal" },
{ "path": "../url" }
],
"include": [ "src/**/*" ]
}
5 changes: 4 additions & 1 deletion packages/data/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ export type DispatchFunction = < StoreNameOrDescriptor >(
? ActionCreatorsOf< ConfigOf< StoreNameOrDescriptor > >
: any;

export type MapSelect = ( select: SelectFunction ) => any;
export type MapSelect = (
select: SelectFunction,
registry: DataRegistry
) => any;

export type SelectFunction = < S >( store: S ) => CurriedSelectorsOf< S >;

Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
{ "path": "packages/block-editor" },
{ "path": "packages/components" },
{ "path": "packages/compose" },
{ "path": "packages/core-data" },
{ "path": "packages/data" },
{ "path": "packages/date" },
{ "path": "packages/deprecated" },
Expand Down

0 comments on commit 5d31bfa

Please sign in to comment.