-
Notifications
You must be signed in to change notification settings - Fork 1
/
sefaria.d.ts
64 lines (55 loc) · 1.34 KB
/
sefaria.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
declare namespace sefaria {
export interface ErrorResponse {
error?: string;
}
// When this becomes a more jagged-type, remove the ts-ignores in sefariaTextType.test.ts
export type TextType = string | string[];
export interface TextLink extends ErrorResponse {
collectiveTitle?: {en: string, he: string};
category?: string;
type?: string;
sourceRef: string;
sourceHeRef: string;
ref: string;
anchorRef: string;
anchorRefExpanded: string[];
versionTitle: string;
originalRefsBeforeRewriting?: string[];
expandedRefsAfterRewriting?: string[];
}
export interface TextLinkWithText extends TextLink {
he: TextType;
text: TextType;
}
export interface TextResponse {
he: TextType;
text: TextType;
ref: string;
title?: string;
indexTitle?: string;
isSpanning?: boolean;
spanningRefs?: string[];
refsPerSubText?: string[];
}
interface BulkTextValue {
he: TextType;
en: TextType;
ref: string;
}
export type BulkTextResponse = Record<string, BulkTextValue>;
interface TopicTitle {
lang: string;
text: string;
primary: boolean;
}
interface HebrewEnglish {
he: string;
en: string;
}
interface Topic {
titles: TopicTitle[];
primaryTitle: HebrewEnglish;
description?: HebrewEnglish;
slug: string;
}
}