Skip to content

Commit

Permalink
refactor(type): Narrow options types
Browse files Browse the repository at this point in the history
  • Loading branch information
freshsomebody committed Jul 5, 2020
1 parent 8a046cc commit dc802d7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ export interface Keypoint {
};

export interface Options {
strategy?: string | Function,
strategy?: 'cosineSimilarity' | 'cosineDistance' | 'weightedDistance' | Function,
customWeight?: WeightOption
};

export interface WeightOption {
mode: string,
mode: WeightOptionMode,
scores: Record<string, number> | number[]
}
export type WeightOptionMode = 'multiply' | 'replace' | 'add'

0 comments on commit dc802d7

Please sign in to comment.