UNPKG

2.52 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 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 type Parameter = {
35 name: string;
36 type: null | Type;
37};
38export type Signature = {
39 parameters: Parameter[];
40 optionalParameters: Parameter[];
41 return: null | Type;
42};
43export 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 skipGlobalChecks?: boolean;
51}
52export interface ProductionBiblioEntry extends BiblioEntryBase {
53 type: 'production';
54 name: string;
55}
56export interface ClauseBiblioEntry extends BiblioEntryBase {
57 type: 'clause';
58 id: string;
59 aoid: string | null;
60 title: string;
61 titleHTML: string;
62 number: string | number;
63}
64export interface TermBiblioEntry extends BiblioEntryBase {
65 type: 'term';
66 term: string;
67 variants?: string[];
68}
69export interface FigureBiblioEntry extends BiblioEntryBase {
70 type: 'table' | 'figure' | 'example' | 'note';
71 id: string;
72 number: string | number;
73 clauseId?: string;
74 caption?: string;
75}
76export interface StepBiblioEntry extends BiblioEntryBase {
77 type: 'step';
78 id: string;
79 stepNumbers: number[];
80}
81export type BiblioEntry = AlgorithmBiblioEntry | ProductionBiblioEntry | ClauseBiblioEntry | TermBiblioEntry | FigureBiblioEntry | StepBiblioEntry;
82type Unkey<T, S extends string> = T extends any ? Omit<T, S> : never;
83type NonExportedKeys = 'location' | 'referencingIds' | 'namespace';
84export type PartialBiblioEntry = Unkey<BiblioEntry, NonExportedKeys>;
85export type ExportedBiblio = {
86 location: string;
87 entries: PartialBiblioEntry[];
88};
89export declare function getKeys(entry: TermBiblioEntry): string[];
90export {};