Skip to content

Commit

Permalink
Refactor Entity typings in entity.ts
Browse files Browse the repository at this point in the history
Changed the EntityKeys type to exclude keys from EntityInternal instead of just symbol and number. Also, fixed a formatting issue with the EntityDataValue type definition.
  • Loading branch information
dennisofficial committed Jun 10, 2024
1 parent de475c7 commit 4972f71
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/entity/entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ export type EntityInternal = {

/** Defines the objects returned from calls to {@link Repository | repositories }. */
export type Entity = EntityData & EntityInternal
export type EntityKeys<T extends Entity> = Exclude<keyof T, symbol | number>
export type EntityKeys<T extends Entity> = Exclude<keyof T, keyof EntityInternal>;

/** The free-form data associated with an {@link Entity}. */
export type EntityData = {
[key: string]: EntityDataValue | EntityData | Array<EntityDataValue | EntityData>
}

/** Valid types for values in an {@link Entity}. */
export type EntityDataValue = string | number | boolean | Date | Point | null | undefined | Array<EntityDataValue | EntityData>
export type EntityDataValue = string | number | boolean | Date | Point | null | undefined | Array<EntityDataValue | EntityData>

/** Defines a point on the globe using longitude and latitude. */
export type Point = {
Expand Down

0 comments on commit 4972f71

Please sign in to comment.