Skip to content

Commit

Permalink
Fix entry.d.ts missing exports (#143)
Browse files Browse the repository at this point in the history
  • Loading branch information
fjc0k committed Nov 12, 2020
1 parent e6827d9 commit 769e332
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions source/entry.d.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
type MapKey<BaseType> = BaseType extends Map<infer KeyType, unknown> ? KeyType : never;
type MapValue<BaseType> = BaseType extends Map<unknown, infer ValueType> ? ValueType : never;

type ArrayEntry<BaseType extends readonly unknown[]> = [number, BaseType[number]];
type MapEntry<BaseType> = [MapKey<BaseType>, MapValue<BaseType>];
type ObjectEntry<BaseType> = [keyof BaseType, BaseType[keyof BaseType]];
type SetEntry<BaseType> = BaseType extends Set<infer ItemType> ? [ItemType, ItemType] : never;
export type ArrayEntry<BaseType extends readonly unknown[]> = [number, BaseType[number]];
export type MapEntry<BaseType> = [MapKey<BaseType>, MapValue<BaseType>];
export type ObjectEntry<BaseType> = [keyof BaseType, BaseType[keyof BaseType]];
export type SetEntry<BaseType> = BaseType extends Set<infer ItemType> ? [ItemType, ItemType] : never;

/**
Many collections have an `entries` method which returns an array of a given object's own enumerable string-keyed property [key, value] pairs. The `Entry` type will return the type of that collection's entry.
Expand Down

0 comments on commit 769e332

Please sign in to comment.