Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tsconfig.json to core-data package #43638

Merged
merged 2 commits into from
Aug 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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