bgmt 0.1.2 → 0.2.0
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/dist/cdn.d.mts +11 -4
- package/dist/cdn.mjs +5 -6
- package/dist/index.d.mts +7 -3813
- package/dist/index.mjs +71 -28
- package/package.json +13 -21
- package/dist/cdn.cjs +0 -25
- package/dist/cdn.d.cts +0 -25
- package/dist/index.cjs +0 -125
- package/dist/index.d.cts +0 -3848
- package/dist/types-qUxe1mrZ.d.cts +0 -31
- /package/dist/{types-CDKF8vJi.d.mts → types-B_6x1YN9.d.mts} +0 -0
package/dist/cdn.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as SubjectSearch, i as SubjectRating, n as FullSubject, r as SubjectImage, t as BasicSubject } from "./types-
|
|
1
|
+
import { a as SubjectSearch, i as SubjectRating, n as FullSubject, r as SubjectImage, t as BasicSubject } from "./types-B_6x1YN9.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/cdn/index.d.ts
|
|
4
4
|
interface CdnOptions {
|
|
@@ -15,9 +15,16 @@ interface CdnOptions {
|
|
|
15
15
|
*/
|
|
16
16
|
baseURL?: string;
|
|
17
17
|
}
|
|
18
|
-
declare function fetchBasicSubjects(options?: CdnOptions): Promise<
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
declare function fetchBasicSubjects(options?: CdnOptions): Promise<{
|
|
19
|
+
version: string;
|
|
20
|
+
subjects: BasicSubject[];
|
|
21
|
+
}>;
|
|
22
|
+
declare function fetchFullSubjects(options?: CdnOptions): Promise<{
|
|
23
|
+
version: string;
|
|
24
|
+
subjects: FullSubject[];
|
|
25
|
+
}>;
|
|
26
|
+
declare function fetchCalendarSubjects(options?: CdnOptions): Promise<{
|
|
27
|
+
version: string;
|
|
21
28
|
calendar: [BasicSubject[], BasicSubject[], BasicSubject[], BasicSubject[], BasicSubject[], BasicSubject[], BasicSubject[]];
|
|
22
29
|
web: BasicSubject[];
|
|
23
30
|
}>;
|
package/dist/cdn.mjs
CHANGED
|
@@ -3,20 +3,19 @@ async function fetchBasicSubjects(options = {}) {
|
|
|
3
3
|
const { version = "0", baseURL = "https://unpkg.com" } = options;
|
|
4
4
|
const resp = await fetch(`${baseURL}/bgmd@${version}/dist/index.json`);
|
|
5
5
|
if (!resp.ok) throw new Error(`Fetch bgmd index.json failed`, { cause: resp });
|
|
6
|
-
return
|
|
6
|
+
return await resp.json();
|
|
7
7
|
}
|
|
8
8
|
async function fetchFullSubjects(options = {}) {
|
|
9
9
|
const { version = "0", baseURL = "https://unpkg.com" } = options;
|
|
10
10
|
const resp = await fetch(`${baseURL}/bgmd@${version}/dist/full.json`);
|
|
11
11
|
if (!resp.ok) throw new Error(`Fetch bgmd full.json failed`, { cause: resp });
|
|
12
|
-
return
|
|
12
|
+
return await resp.json();
|
|
13
13
|
}
|
|
14
|
-
async function fetchCalendarSubjects(options) {
|
|
14
|
+
async function fetchCalendarSubjects(options = {}) {
|
|
15
15
|
const { version = "0", baseURL = "https://unpkg.com" } = options;
|
|
16
16
|
const resp = await fetch(`${baseURL}/bgmd@${version}/dist/calendar.json`);
|
|
17
17
|
if (!resp.ok) throw new Error(`Fetch bgmd calendar.json failed`, { cause: resp });
|
|
18
|
-
return
|
|
18
|
+
return await resp.json();
|
|
19
19
|
}
|
|
20
|
-
|
|
21
20
|
//#endregion
|
|
22
|
-
export { fetchBasicSubjects, fetchCalendarSubjects, fetchFullSubjects };
|
|
21
|
+
export { fetchBasicSubjects, fetchCalendarSubjects, fetchFullSubjects };
|