Skip to content

Commit

Permalink
Type signatures for getEntityRecord and getEntityRecords
Browse files Browse the repository at this point in the history
  • Loading branch information
adamziel committed May 26, 2022
1 parent 0d5c143 commit c5a97cf
Show file tree
Hide file tree
Showing 4 changed files with 374 additions and 246 deletions.
6 changes: 3 additions & 3 deletions packages/core-data/src/entity-types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import type { Widget } from './widget';
import type { WidgetType } from './widget-type';
import type { WpTemplate } from './wp-template';
import type { WpTemplatePart } from './wp-template-part';
import type { EntityQuery, State } from '../selectors';
import type { CoreEntities } from '../entities';

export type { EntityType } from './entities';
Expand Down Expand Up @@ -134,9 +133,10 @@ export type KeyOf<
RecordOrKind extends EntityRecord | Kind,
N extends Name = undefined,
E extends EntityConfig = EntityConfigOf< RecordOrKind, N >
> = E[ 'key' ] extends keyof E[ 'record' ]
> = ( E[ 'key' ] extends keyof E[ 'record' ]
? E[ 'record' ][ E[ 'key' ] ]
: never;
: never ) &
( number | string );

/**
* Default context of the requested entity, sourced from PerPackageEntities.
Expand Down
3 changes: 0 additions & 3 deletions packages/core-data/src/rememo.d.ts

This file was deleted.

Loading

0 comments on commit c5a97cf

Please sign in to comment.