@youversion/platform-react-native 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.releaserc.json +104 -0
- package/CHANGELOG.md +29 -0
- package/CONTRIBUTING.md +319 -0
- package/LICENSE +201 -0
- package/README.md +562 -0
- package/RELEASING.md +85 -0
- package/android/build.gradle +43 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/assets/github-reactNative-sdk-banner.png +0 -0
- package/build/api/bible.d.ts +26 -0
- package/build/api/bible.d.ts.map +1 -0
- package/build/api/bible.js +32 -0
- package/build/api/bible.js.map +1 -0
- package/build/api/highlights.d.ts +109 -0
- package/build/api/highlights.d.ts.map +1 -0
- package/build/api/highlights.js +49 -0
- package/build/api/highlights.js.map +1 -0
- package/build/api/index.d.ts +27 -0
- package/build/api/index.d.ts.map +1 -0
- package/build/api/index.js +13 -0
- package/build/api/index.js.map +1 -0
- package/build/api/languages.d.ts +11 -0
- package/build/api/languages.d.ts.map +1 -0
- package/build/api/languages.js +13 -0
- package/build/api/languages.js.map +1 -0
- package/build/api/users.d.ts +20 -0
- package/build/api/users.d.ts.map +1 -0
- package/build/api/users.js +26 -0
- package/build/api/users.js.map +1 -0
- package/build/api/votd.d.ts +15 -0
- package/build/api/votd.d.ts.map +1 -0
- package/build/api/votd.js +13 -0
- package/build/api/votd.js.map +1 -0
- package/build/components/BibleReaderView.d.ts +22 -0
- package/build/components/BibleReaderView.d.ts.map +1 -0
- package/build/components/BibleReaderView.js +18 -0
- package/build/components/BibleReaderView.js.map +1 -0
- package/build/components/BibleTextView.d.ts +18 -0
- package/build/components/BibleTextView.d.ts.map +1 -0
- package/build/components/BibleTextView.js +25 -0
- package/build/components/BibleTextView.js.map +1 -0
- package/build/components/BibleWidgetView.d.ts +23 -0
- package/build/components/BibleWidgetView.d.ts.map +1 -0
- package/build/components/BibleWidgetView.js +17 -0
- package/build/components/BibleWidgetView.js.map +1 -0
- package/build/components/SignInWithYouVersionButton.d.ts +37 -0
- package/build/components/SignInWithYouVersionButton.d.ts.map +1 -0
- package/build/components/SignInWithYouVersionButton.js +12 -0
- package/build/components/SignInWithYouVersionButton.js.map +1 -0
- package/build/components/VotdView.d.ts +11 -0
- package/build/components/VotdView.d.ts.map +1 -0
- package/build/components/VotdView.js +12 -0
- package/build/components/VotdView.js.map +1 -0
- package/build/components/index.d.ts +6 -0
- package/build/components/index.d.ts.map +1 -0
- package/build/components/index.js +6 -0
- package/build/components/index.js.map +1 -0
- package/build/index.d.ts +5 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +6 -0
- package/build/index.js.map +1 -0
- package/build/native.d.ts +22 -0
- package/build/native.d.ts.map +1 -0
- package/build/native.js +3 -0
- package/build/native.js.map +1 -0
- package/build/platform.d.ts +21 -0
- package/build/platform.d.ts.map +1 -0
- package/build/platform.js +28 -0
- package/build/platform.js.map +1 -0
- package/build/types.d.ts +320 -0
- package/build/types.d.ts.map +1 -0
- package/build/types.js +2 -0
- package/build/types.js.map +1 -0
- package/commitlint.config.js +23 -0
- package/dist/youversion-platform-react-native-0.7.2.tgz +0 -0
- package/eslint.config.js +4 -0
- package/expo-module.config.json +17 -0
- package/ios/APIs/YVPBibleAPI.swift +197 -0
- package/ios/APIs/YVPHighlightsAPI.swift +105 -0
- package/ios/APIs/YVPLanguagesAPI.swift +70 -0
- package/ios/RNBibleReaderViewModule.swift +9 -0
- package/ios/RNBibleTextViewModule.swift +9 -0
- package/ios/RNBibleWidgetViewModule.swift +9 -0
- package/ios/RNSignInWithYouVersionButtonModule.swift +9 -0
- package/ios/RNVotdViewModule.swift +9 -0
- package/ios/RNYouVersionPlatformModule.swift +79 -0
- package/ios/Views/YVPBibleReaderView.swift +57 -0
- package/ios/Views/YVPBibleTextView.swift +114 -0
- package/ios/Views/YVPBibleWidgetView.swift +64 -0
- package/ios/Views/YVPSignInWithYouVersionButton.swift +52 -0
- package/ios/Views/YVPVotdView.swift +35 -0
- package/ios/YVPAuthAPI.swift +77 -0
- package/ios/YVPVotdAPI.swift +20 -0
- package/ios/YVPlatform.swift +17 -0
- package/ios/YouVersionReactNative.podspec +33 -0
- package/mocks/RNYouVersionPlatform.ts +146 -0
- package/package.json +58 -0
- package/scripts/release-local.sh +224 -0
- package/scripts/sync-android-version.js +75 -0
- package/src/api/bible.ts +35 -0
- package/src/api/highlights.ts +145 -0
- package/src/api/index.ts +13 -0
- package/src/api/languages.ts +14 -0
- package/src/api/users.ts +35 -0
- package/src/api/votd.ts +20 -0
- package/src/components/BibleReaderView.tsx +52 -0
- package/src/components/BibleTextView.tsx +63 -0
- package/src/components/BibleWidgetView.tsx +45 -0
- package/src/components/SignInWithYouVersionButton.tsx +70 -0
- package/src/components/VotdView.tsx +36 -0
- package/src/components/index.ts +5 -0
- package/src/index.ts +5 -0
- package/src/native.ts +58 -0
- package/src/platform.ts +30 -0
- package/src/types.ts +382 -0
- package/tsconfig.json +9 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { requireNativeView } from "expo";
|
|
2
|
+
import { StyleProp, StyleSheet, ViewStyle } from "react-native";
|
|
3
|
+
|
|
4
|
+
import { BibleReference } from "../types";
|
|
5
|
+
|
|
6
|
+
const NativeView: React.ComponentType<NativeProps> =
|
|
7
|
+
requireNativeView("BibleWidgetView");
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* An opinionated Bible passage display.
|
|
11
|
+
* It displays the book, chapter and version name above the passage. Below the passage text, it displays copyright information and the YouVersion logo.
|
|
12
|
+
* @param props - {@link BibleWidgetViewProps}
|
|
13
|
+
*/
|
|
14
|
+
export function BibleWidgetView({ reference, ...props }: BibleWidgetViewProps) {
|
|
15
|
+
return <NativeView {...(reference || {})} style={styles.view} {...props} />;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const styles = StyleSheet.create({
|
|
19
|
+
view: {
|
|
20
|
+
alignSelf: "stretch",
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export interface BibleWidgetViewProps {
|
|
25
|
+
/** A reference to a passage in the Bible. This could be a single verse, a range of verses or the entire chapter */
|
|
26
|
+
reference: BibleReference;
|
|
27
|
+
|
|
28
|
+
/** The font size to use for the Bible text
|
|
29
|
+
*
|
|
30
|
+
* @defaultValue 23
|
|
31
|
+
*/
|
|
32
|
+
fontSize?: number | null | undefined;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Controls the color scheme of the button
|
|
36
|
+
*
|
|
37
|
+
* * @defaultValue Uses the system color scheme
|
|
38
|
+
*/
|
|
39
|
+
colorScheme?: "light" | "dark" | null | undefined;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
type NativeProps = Omit<BibleWidgetViewProps, "reference"> &
|
|
43
|
+
BibleReference & {
|
|
44
|
+
style?: StyleProp<ViewStyle>;
|
|
45
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { requireNativeView } from "expo";
|
|
2
|
+
import { StyleProp, ViewStyle } from "react-native";
|
|
3
|
+
|
|
4
|
+
const NativeView: React.ComponentType<NativeProps> = requireNativeView(
|
|
5
|
+
"SignInWithYouVersionButton",
|
|
6
|
+
);
|
|
7
|
+
|
|
8
|
+
type NativeProps = Omit<SignInWithYouVersionButtonProps, "onPress"> & {
|
|
9
|
+
onTap?: () => void;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export interface SignInWithYouVersionButtonProps {
|
|
13
|
+
/** Controls the width and text of the button
|
|
14
|
+
*
|
|
15
|
+
* @defaultValue "full"
|
|
16
|
+
*/
|
|
17
|
+
mode?: SignInWithYouVersionButtonMode;
|
|
18
|
+
|
|
19
|
+
/** Controls the border radius of the button
|
|
20
|
+
*
|
|
21
|
+
* @defaultValue "capsule"
|
|
22
|
+
*/
|
|
23
|
+
shape?: SignInWithYouVersionButtonShape;
|
|
24
|
+
|
|
25
|
+
/** Controls if the button is outlined
|
|
26
|
+
*
|
|
27
|
+
* @defaultValue true
|
|
28
|
+
*/
|
|
29
|
+
isStroked?: boolean;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Controls the color scheme of the button
|
|
33
|
+
*
|
|
34
|
+
* @defaultValue Uses the system color scheme
|
|
35
|
+
*/
|
|
36
|
+
colorScheme?: "light" | "dark";
|
|
37
|
+
|
|
38
|
+
/** Called when the user taps the button. You should call the signIn function in response */
|
|
39
|
+
onPress?: () => void;
|
|
40
|
+
style?: StyleProp<ViewStyle>;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export type SignInWithYouVersionButtonMode = "full" | "compact" | "iconOnly";
|
|
44
|
+
export type SignInWithYouVersionButtonShape = "capsule" | "rectangle";
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* A branded button for signing in with YouVersion.
|
|
48
|
+
* This button is a lightweight wrapper around the native YouVersion sign-in button. It contains
|
|
49
|
+
* localized sign-in text and the YouVersion logo.
|
|
50
|
+
* @param props - {@link SignInWithYouVersionButtonProps}
|
|
51
|
+
*/
|
|
52
|
+
export function SignInWithYouVersionButton({
|
|
53
|
+
onPress,
|
|
54
|
+
mode = "full",
|
|
55
|
+
shape = "capsule",
|
|
56
|
+
isStroked = true,
|
|
57
|
+
colorScheme,
|
|
58
|
+
...props
|
|
59
|
+
}: SignInWithYouVersionButtonProps) {
|
|
60
|
+
return (
|
|
61
|
+
<NativeView
|
|
62
|
+
{...props}
|
|
63
|
+
mode={mode}
|
|
64
|
+
shape={shape}
|
|
65
|
+
isStroked={isStroked}
|
|
66
|
+
colorScheme={colorScheme}
|
|
67
|
+
onTap={onPress}
|
|
68
|
+
/>
|
|
69
|
+
);
|
|
70
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { requireNativeView } from "expo";
|
|
2
|
+
import { StyleProp, StyleSheet, ViewStyle } from "react-native";
|
|
3
|
+
|
|
4
|
+
const NativeView: React.ComponentType<NativeProps> =
|
|
5
|
+
requireNativeView("VotdView");
|
|
6
|
+
|
|
7
|
+
export function VotdView({ bibleVersionId = 111, ...props }: VotdViewProps) {
|
|
8
|
+
return (
|
|
9
|
+
<NativeView
|
|
10
|
+
style={styles.view}
|
|
11
|
+
bibleVersionId={bibleVersionId}
|
|
12
|
+
{...props}
|
|
13
|
+
/>
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const styles = StyleSheet.create({
|
|
18
|
+
view: {
|
|
19
|
+
alignSelf: "stretch",
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
export interface VotdViewProps {
|
|
24
|
+
bibleVersionId?: number | null | undefined;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Controls the color scheme of the text. "dark" would mean to use light text on a dark background, and "light" would mean to use dark text on a light background.
|
|
28
|
+
*
|
|
29
|
+
* * @defaultValue Uses the system color scheme
|
|
30
|
+
*/
|
|
31
|
+
colorScheme?: "light" | "dark" | null | undefined;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
interface NativeProps extends VotdViewProps {
|
|
35
|
+
style: StyleProp<ViewStyle>;
|
|
36
|
+
}
|
package/src/index.ts
ADDED
package/src/native.ts
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { NativeModule, requireNativeModule } from "expo";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
BibleReference,
|
|
5
|
+
BibleVersion,
|
|
6
|
+
HighlightResponse,
|
|
7
|
+
LanguageOverview,
|
|
8
|
+
SignInWithYouVersionResult,
|
|
9
|
+
YouVersionUserInfo,
|
|
10
|
+
YouVersionVerseOfTheDay,
|
|
11
|
+
} from "./types";
|
|
12
|
+
|
|
13
|
+
declare class RNYouVersionPlatformModule extends NativeModule {
|
|
14
|
+
configure(appKey: string): void;
|
|
15
|
+
|
|
16
|
+
setApiHost(apiHost: string): void;
|
|
17
|
+
|
|
18
|
+
signIn(permissions: string[]): Promise<SignInWithYouVersionResult>;
|
|
19
|
+
|
|
20
|
+
signOut(): Promise<void>;
|
|
21
|
+
|
|
22
|
+
userInfo(accessToken?: string): Promise<YouVersionUserInfo>;
|
|
23
|
+
|
|
24
|
+
verseOfTheDay(dayOfYear: number): Promise<YouVersionVerseOfTheDay>;
|
|
25
|
+
|
|
26
|
+
createHighlight(
|
|
27
|
+
versionId: number,
|
|
28
|
+
passageId: string,
|
|
29
|
+
color: string,
|
|
30
|
+
): Promise<boolean>;
|
|
31
|
+
|
|
32
|
+
getHighlights(
|
|
33
|
+
versionId: number,
|
|
34
|
+
passageId: string,
|
|
35
|
+
): Promise<HighlightResponse[]>;
|
|
36
|
+
|
|
37
|
+
updateHighlight(
|
|
38
|
+
versionId: number,
|
|
39
|
+
passageId: string,
|
|
40
|
+
color: string,
|
|
41
|
+
): Promise<boolean>;
|
|
42
|
+
|
|
43
|
+
deleteHighlight(versionId: number, passageId: string): Promise<boolean>;
|
|
44
|
+
|
|
45
|
+
languages(country?: string): Promise<LanguageOverview[]>;
|
|
46
|
+
|
|
47
|
+
versions(languageTag?: string): Promise<BibleVersion[]>;
|
|
48
|
+
|
|
49
|
+
version(versionId: number): Promise<BibleVersion>;
|
|
50
|
+
|
|
51
|
+
chapter(bibleReference: BibleReference): Promise<string>;
|
|
52
|
+
|
|
53
|
+
getAccessToken(): string | null;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export const Module = requireNativeModule<RNYouVersionPlatformModule>(
|
|
57
|
+
"RNYouVersionPlatform",
|
|
58
|
+
);
|
package/src/platform.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Module } from "./native";
|
|
2
|
+
|
|
3
|
+
export const YouVersionPlatform = {
|
|
4
|
+
/**
|
|
5
|
+
* Function to configure YouVersionPlatform.
|
|
6
|
+
* Run this once during your app's initialization.
|
|
7
|
+
*
|
|
8
|
+
* @param appKey - The application key provided for your app.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* // During app initialization:
|
|
12
|
+
* YouVersionPlatform.configure('YOUR_APP_KEY');
|
|
13
|
+
*/
|
|
14
|
+
configure(appKey: string) {
|
|
15
|
+
return Module.configure(appKey);
|
|
16
|
+
},
|
|
17
|
+
|
|
18
|
+
setApiHost(apiHost: string) {
|
|
19
|
+
return Module.setApiHost(apiHost);
|
|
20
|
+
},
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Retrieves the currently cached access token for the authenticated user.
|
|
24
|
+
*
|
|
25
|
+
* @returns The access token as a string, or null if not available.
|
|
26
|
+
*/
|
|
27
|
+
getAccessToken(): string | null {
|
|
28
|
+
return Module.getAccessToken();
|
|
29
|
+
},
|
|
30
|
+
};
|
package/src/types.ts
ADDED
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
import { ColorValue } from "react-native";
|
|
2
|
+
|
|
3
|
+
export type SignInWithYouVersionResult = {
|
|
4
|
+
accessToken?: string;
|
|
5
|
+
permissions: SignInWithYouVersionPermission[];
|
|
6
|
+
yvpUserId?: string;
|
|
7
|
+
expiryDate?: string;
|
|
8
|
+
refreshToken?: string;
|
|
9
|
+
name?: string;
|
|
10
|
+
profilePicture?: string;
|
|
11
|
+
email?: string;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export type SignInWithYouVersionPermission =
|
|
15
|
+
| "bibles"
|
|
16
|
+
| "highlights"
|
|
17
|
+
| "votd"
|
|
18
|
+
| "demographics"
|
|
19
|
+
| "bible_activity";
|
|
20
|
+
|
|
21
|
+
export interface YouVersionUserInfo {
|
|
22
|
+
firstName?: string;
|
|
23
|
+
lastName?: string;
|
|
24
|
+
userId?: string;
|
|
25
|
+
avatarUrl?: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface YouVersionVerseOfTheDay {
|
|
29
|
+
passageId: string;
|
|
30
|
+
day: number;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface BibleTextOptions {
|
|
34
|
+
/**
|
|
35
|
+
* Controls the font family of the Bible text
|
|
36
|
+
*
|
|
37
|
+
* @defaultValue "Times New Roman"
|
|
38
|
+
*/
|
|
39
|
+
fontFamily?: string | null | undefined;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Controls the font size of the Bible text
|
|
43
|
+
*
|
|
44
|
+
* @defaultValue 16
|
|
45
|
+
*/
|
|
46
|
+
fontSize?: number | null | undefined;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Controls the line spacing of the Bible text
|
|
50
|
+
*
|
|
51
|
+
* @defaultValue `fontSize` / 2
|
|
52
|
+
*/
|
|
53
|
+
lineSpacing?: number | null | undefined;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Controls the spacing between paragraphs in the Bible text
|
|
57
|
+
*
|
|
58
|
+
* @defaultValue `fontSize` / 2
|
|
59
|
+
*/
|
|
60
|
+
paragraphSpacing?: number | null | undefined;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Controls the text color of the Bible text
|
|
64
|
+
*
|
|
65
|
+
* @defaultValue Theme dependent text color
|
|
66
|
+
*/
|
|
67
|
+
textColor?: ColorValue | null | undefined;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Controls the color of the words of Christ (WOC) in the Bible text
|
|
71
|
+
*
|
|
72
|
+
* @defaultValue "#FF3D4D" in light mode, "#F04C59" in dark mode
|
|
73
|
+
*/
|
|
74
|
+
wocColor?: ColorValue | null | undefined;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Controls how footnotes are displayed in the Bible text
|
|
78
|
+
*
|
|
79
|
+
* @defaultValue "none"
|
|
80
|
+
*/
|
|
81
|
+
footnoteMode?: BibleTextFootnoteMode | null | undefined;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Controls whether verse numbers are rendered in the Bible text
|
|
85
|
+
*
|
|
86
|
+
* @defaultValue true
|
|
87
|
+
*/
|
|
88
|
+
renderVerseNumbers?: boolean | null | undefined;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export type BibleTextFootnoteMode = "none" | "inline" | "marker";
|
|
92
|
+
|
|
93
|
+
interface BibleReferenceBase {
|
|
94
|
+
/** The ID of the Bible version */
|
|
95
|
+
versionId: number;
|
|
96
|
+
|
|
97
|
+
/** The book identifier */
|
|
98
|
+
bookUSFM: string;
|
|
99
|
+
|
|
100
|
+
/** The chapter number */
|
|
101
|
+
chapter: number;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* A reference to a range of verses
|
|
106
|
+
*/
|
|
107
|
+
export interface BibleReferenceVerseRange extends BibleReferenceBase {
|
|
108
|
+
type: "range";
|
|
109
|
+
verseStart: number;
|
|
110
|
+
verseEnd: number;
|
|
111
|
+
verse?: never;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* A reference to an entire chapter in the Bible
|
|
116
|
+
*/
|
|
117
|
+
export interface BibleReferenceChapter extends BibleReferenceBase {
|
|
118
|
+
type: "chapter";
|
|
119
|
+
verse?: never;
|
|
120
|
+
verseStart?: never;
|
|
121
|
+
verseEnd?: never;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* A reference to a single verse in the Bible
|
|
126
|
+
*/
|
|
127
|
+
export interface BibleReferenceVerse extends BibleReferenceBase {
|
|
128
|
+
type: "verse";
|
|
129
|
+
verse: number;
|
|
130
|
+
verseStart?: never;
|
|
131
|
+
verseEnd?: never;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export type BibleReference =
|
|
135
|
+
| BibleReferenceVerseRange
|
|
136
|
+
| BibleReferenceChapter
|
|
137
|
+
| BibleReferenceVerse;
|
|
138
|
+
|
|
139
|
+
export interface OnBibleTextPressEvent {
|
|
140
|
+
/** A reference to the Bible verse that was pressed */
|
|
141
|
+
bibleReference: BibleReferenceVerse;
|
|
142
|
+
|
|
143
|
+
/** The coordinates of the press event */
|
|
144
|
+
point: {
|
|
145
|
+
x: number;
|
|
146
|
+
y: number;
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export interface LanguageOverview {
|
|
151
|
+
/**
|
|
152
|
+
* Canonical BCP 47 id limited to language or language+script. Region, variants, and extensions are not allowed.
|
|
153
|
+
*
|
|
154
|
+
* @example "en"
|
|
155
|
+
*/
|
|
156
|
+
id: string;
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* ISO 639 canonical language subtag
|
|
160
|
+
*
|
|
161
|
+
* @example "sr"
|
|
162
|
+
*/
|
|
163
|
+
language: string;
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* ISO 15924 script code if present in id
|
|
167
|
+
*
|
|
168
|
+
* @example "Latn"
|
|
169
|
+
*/
|
|
170
|
+
script?: string;
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* The English name for the script
|
|
174
|
+
*
|
|
175
|
+
* @example "Latin"
|
|
176
|
+
*/
|
|
177
|
+
scriptName?: string;
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Deprecated or legacy subtags mapped during canonicalization for this language.
|
|
181
|
+
*
|
|
182
|
+
* @example []
|
|
183
|
+
*/
|
|
184
|
+
aliases: string[];
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Localized display names for the language/script combination
|
|
188
|
+
* @example { "en": "Chechen" }
|
|
189
|
+
*/
|
|
190
|
+
displayNames: Record<string, string>;
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* All scripts known for this language (CLDR/ISO-15924)
|
|
194
|
+
*
|
|
195
|
+
* @example ["Cyrl", "Latn"]
|
|
196
|
+
*/
|
|
197
|
+
scripts: string[];
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Variants associated with this language (not part of the id)
|
|
201
|
+
*
|
|
202
|
+
* @example ["1996","fonipa"]
|
|
203
|
+
*/
|
|
204
|
+
variants: string[];
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Ids of countries where this language is used or supported. Extended details can be retrieved from the countries API with the provided id.
|
|
208
|
+
*
|
|
209
|
+
* @example ["RS","BA","ME"]
|
|
210
|
+
*/
|
|
211
|
+
countries: string[];
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Default text direction for this language. ltr is left to right and rtl is right to left.
|
|
215
|
+
*
|
|
216
|
+
* @example "ltr"
|
|
217
|
+
*/
|
|
218
|
+
textDirection: string;
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* The chosen default Bible version for this language.
|
|
222
|
+
*
|
|
223
|
+
* @example 111
|
|
224
|
+
*/
|
|
225
|
+
defaultBibleVersionId?: number;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
export interface HighlightResponse {
|
|
229
|
+
id?: string;
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Bible version identifier
|
|
233
|
+
*
|
|
234
|
+
* @example 111
|
|
235
|
+
*/
|
|
236
|
+
bibleId: number;
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* The passage identifier (verse USFM format)
|
|
240
|
+
*
|
|
241
|
+
* @example "MAT.1.1"
|
|
242
|
+
*/
|
|
243
|
+
passageId: string;
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* The highlight color in hex format
|
|
247
|
+
*
|
|
248
|
+
* @example "#44aa44"
|
|
249
|
+
*/
|
|
250
|
+
color: string;
|
|
251
|
+
userId?: string;
|
|
252
|
+
createTime?: string;
|
|
253
|
+
updateTime?: string;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
export interface BibleVersion {
|
|
257
|
+
/**
|
|
258
|
+
* Bible version identifier
|
|
259
|
+
*
|
|
260
|
+
* @example 111
|
|
261
|
+
*/
|
|
262
|
+
id: number;
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* Bible version abbreviation
|
|
266
|
+
*
|
|
267
|
+
* @example "NIV"
|
|
268
|
+
*/
|
|
269
|
+
abbreviation?: string;
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* Longer form of copyright text provided by the publisher for the given Bible version.
|
|
273
|
+
*
|
|
274
|
+
* @example "<p>Biblica is the worldwide publisher and translation sponsor of the New International Version—one of the most widely read contemporary English versions of the Bible. </p> <p>At Biblica, we believe that with God, all things are possible. Partnering with other ministries and people like you, we are reaching the world with God’s Word, providing Bibles that are easier to understand and faster to receive. When God’s Word is put into someone’s hands, it has the power to change everything. </p> <p>To learn more, visit <a href="https://www.biblica.com/privacy-policy/">biblica.com</a> and <a href="http://facebook.com/Biblica">facebook.com/Biblica</a>.</p> <p> </p>"
|
|
275
|
+
*/
|
|
276
|
+
copyrightLong?: string;
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* Short version of the copyright text provided by the publisher for the given Bible version.
|
|
280
|
+
*
|
|
281
|
+
* @example "The Holy Bible, New International Version® NIV® Copyright © 1973, 1978, 1984, 2011 by Biblica, Inc.® Used by Permission of Biblica, Inc.® All rights reserved worldwide."
|
|
282
|
+
*/
|
|
283
|
+
copyrightShort?: string;
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* BCP47 canonical language tag for this Bible version
|
|
287
|
+
*
|
|
288
|
+
* @example "en"
|
|
289
|
+
*/
|
|
290
|
+
languageTag?: string;
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* Localized Bible version abbreviation
|
|
294
|
+
*
|
|
295
|
+
* @example "NIV"
|
|
296
|
+
*/
|
|
297
|
+
localizedAbbreviation?: string;
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* Localized title of Bible version
|
|
301
|
+
*
|
|
302
|
+
* @example "New International Version"
|
|
303
|
+
*/
|
|
304
|
+
localizedTitle?: string;
|
|
305
|
+
|
|
306
|
+
readerFooter?: string;
|
|
307
|
+
readerFooterUrl?: string;
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* English title of Bible version
|
|
311
|
+
*
|
|
312
|
+
* @example "New International Version 2011"
|
|
313
|
+
*/
|
|
314
|
+
title?: string;
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* Array of book codes for this Bible version
|
|
318
|
+
*
|
|
319
|
+
* @example ["GEN","EXO","LEV"]
|
|
320
|
+
*/
|
|
321
|
+
bookCodes?: string[];
|
|
322
|
+
|
|
323
|
+
/** Array of Bible books for this Bible version */
|
|
324
|
+
books?: BibleBook[];
|
|
325
|
+
|
|
326
|
+
/**
|
|
327
|
+
* Default text direction for this language. ltr is left to right and rtl is right to left.
|
|
328
|
+
*
|
|
329
|
+
* @example "ltr"
|
|
330
|
+
*/
|
|
331
|
+
textDirection?: string;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
export interface BibleBook {
|
|
335
|
+
/**
|
|
336
|
+
* Standard book identifier for the Unified Scripture Format Markup (USFM) used in Scripture text processing
|
|
337
|
+
*
|
|
338
|
+
* @example "GEN"
|
|
339
|
+
*/
|
|
340
|
+
usfm?: string;
|
|
341
|
+
|
|
342
|
+
/**
|
|
343
|
+
* Book name abbreviation if provided by the publisher
|
|
344
|
+
*
|
|
345
|
+
* @example "Gen"
|
|
346
|
+
*/
|
|
347
|
+
abbreviation?: string;
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* Book title
|
|
351
|
+
*
|
|
352
|
+
* @example "Genesis"
|
|
353
|
+
*/
|
|
354
|
+
title?: string;
|
|
355
|
+
titleLong?: string;
|
|
356
|
+
chapters?: BibleChapter[];
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
export interface BibleChapter {
|
|
360
|
+
/**
|
|
361
|
+
* Book identifier
|
|
362
|
+
*
|
|
363
|
+
* @example "GEN"
|
|
364
|
+
*/
|
|
365
|
+
bookUSFM?: string;
|
|
366
|
+
|
|
367
|
+
isCanonical?: boolean;
|
|
368
|
+
|
|
369
|
+
/**
|
|
370
|
+
* Canonical representation of the passage
|
|
371
|
+
*
|
|
372
|
+
* @example "GEN.1"
|
|
373
|
+
*/
|
|
374
|
+
passageId?: string;
|
|
375
|
+
|
|
376
|
+
/**
|
|
377
|
+
* Human readable chapter title
|
|
378
|
+
*
|
|
379
|
+
* @example "1"
|
|
380
|
+
*/
|
|
381
|
+
title?: string;
|
|
382
|
+
}
|
package/tsconfig.json
ADDED