Skip to content

Commit

Permalink
ProjectionFn -> BranchProjection
Browse files Browse the repository at this point in the history
  • Loading branch information
joscha committed Sep 24, 2024
1 parent ad181b6 commit 040aed7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ interface EncoderOptions {
* The index muss be a number between 0 and length-1 of the passed types.
* In this case (a branch index) the union will use an unwrapped representation. Otherwise (undefined), the union will be wrapped.
*/
type ProjectionFn = (types: ReadonlyArray<Type>) => ((val: unknown) => number) | undefined;
type BranchProjection = (types: ReadonlyArray<Type>) =>
| ((val: unknown) => number)
| undefined;

interface ForSchemaOptions {
assertLogicalTypes: boolean;
Expand All @@ -113,7 +115,7 @@ interface ForSchemaOptions {
omitRecordMethods: boolean;
registry: { [name: string]: Type };
typeHook: (schema: Schema | string, opts: ForSchemaOptions) => Type | undefined;
wrapUnions: ProjectionFn | boolean | 'auto' | 'always' | 'never';
wrapUnions: BranchProjection | boolean | 'auto' | 'always' | 'never';
}

interface TypeOptions extends ForSchemaOptions {
Expand Down

0 comments on commit 040aed7

Please sign in to comment.