UNPKG

2.56 kBTypeScriptView Raw
1export interface BiblioEntryBase {
2 type: string;
3 location: string;
4 namespace?: string;
5 id?: string;
6 refId?: string;
7 aoid?: string | null;
8 referencingIds: string[];
9}
10export declare type Type = {
11 kind: 'opaque';
12 type: string;
13} | {
14 kind: 'unused';
15} | {
16 kind: 'completion';
17 completionType: 'abrupt';
18} | {
19 kind: 'completion';
20 typeOfValueIfNormal: Type | null;
21 completionType: 'normal' | 'mixed';
22} | {
23 kind: 'list';
24 elements: Type | null;
25} | {
26 kind: 'union';
27 types: Exclude<Type, {
28 kind: 'union';
29 }>[];
30} | {
31 kind: 'record';
32 fields: Record<string, Type | null>;
33};
34export declare type Parameter = {
35 name: string;
36 type: null | Type;
37};
38export declare type Signature = {
39 parameters: Parameter[];
40 optionalParameters: Parameter[];
41 return: null | Type;
42};
43export declare type AlgorithmType = 'abstract operation' | 'host-defined abstract operation' | 'implementation-defined abstract operation' | 'syntax-directed operation' | 'numeric method';
44export interface AlgorithmBiblioEntry extends BiblioEntryBase {
45 type: 'op';
46 aoid: string;
47 kind?: AlgorithmType;
48 signature: null | Signature;
49 effects: string[];
50}
51export interface ProductionBiblioEntry extends BiblioEntryBase {
52 type: 'production';
53 name: string;
54}
55export interface ClauseBiblioEntry extends BiblioEntryBase {
56 type: 'clause';
57 id: string;
58 aoid: string | null;
59 title: string;
60 titleHTML: string;
61 number: string | number;
62}
63export interface TermBiblioEntry extends BiblioEntryBase {
64 type: 'term';
65 term: string;
66 variants?: string[];
67}
68export interface FigureBiblioEntry extends BiblioEntryBase {
69 type: 'table' | 'figure' | 'example' | 'note';
70 id: string;
71 number: string | number;
72 clauseId?: string;
73 caption?: string;
74}
75export interface StepBiblioEntry extends BiblioEntryBase {
76 type: 'step';
77 id: string;
78 stepNumbers: number[];
79}
80export declare type BiblioEntry = AlgorithmBiblioEntry | ProductionBiblioEntry | ClauseBiblioEntry | TermBiblioEntry | FigureBiblioEntry | StepBiblioEntry;
81declare type Unkey<T, S extends string> = T extends any ? Omit<T, S> : never;
82declare type NonExportedKeys = 'location' | 'referencingIds' | 'namespace';
83export declare type PartialBiblioEntry = Unkey<BiblioEntry, NonExportedKeys>;
84export declare type ExportedBiblio = {
85 location: string;
86 entries: PartialBiblioEntry[];
87};
88export declare function getKeys(entry: TermBiblioEntry): string[];
89export {};