UNPKG

1 kBTypeScriptView Raw
1export declare function isTermLike<TermType extends string = string, Value extends string = string>(given: unknown, termType?: TermType, value?: Value): given is TermLike<TermType, Value>;
2export declare function isTerm<TermType extends string = string, Value extends string = string>(given: unknown, termType?: TermType, value?: Value): given is Term<TermType, Value>;
3export interface Term<TermType extends string = string, Value extends string = string> {
4 readonly termType: TermType;
5 readonly value: Value;
6 equals(other: unknown): other is TermLike<TermType, Value>;
7}
8export declare class Term<TermType extends string = string, Value extends string = string> implements Term<TermType, Value> {
9 readonly termType: TermType;
10 readonly value: Value;
11 protected constructor(termType: TermType, value: Value);
12 toJSON(): object;
13}
14export declare type TermLike<TermType extends string = string, Value extends string = string> = Pick<Term<TermType, Value>, "termType" | "value">;