@das-fed/upf-utils 6.4.0-dev.259 → 6.4.0-dev.260
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/api-services/es5.js +1760 -1798
- package/api-services/index.js +1417 -1455
- package/api-services/index.js.gz +0 -0
- package/api-services/modules/app-manage/es5.js +721 -749
- package/api-services/modules/app-manage/index.js +565 -588
- package/api-services/modules/app-manage/index.js.gz +0 -0
- package/api-services/modules/authentication/es5.js +1273 -1310
- package/api-services/modules/authentication/index.js +1043 -1080
- package/api-services/modules/authentication/index.js.gz +0 -0
- package/api-services/modules/bems/es5.js +798 -826
- package/api-services/modules/bems/index.js +644 -667
- package/api-services/modules/bems/index.js.gz +0 -0
- package/api-services/modules/contract/es5.js +1281 -1297
- package/api-services/modules/contract/index.js +1063 -1068
- package/api-services/modules/contract/index.js.gz +0 -0
- package/api-services/modules/duty-manage/es5.js +1288 -1304
- package/api-services/modules/duty-manage/index.js +1065 -1070
- package/api-services/modules/duty-manage/index.js.gz +0 -0
- package/api-services/modules/enterpriseright/es5.js +1279 -1298
- package/api-services/modules/enterpriseright/index.js +1061 -1070
- package/api-services/modules/enterpriseright/index.js.gz +0 -0
- package/api-services/modules/es5.js +899 -928
- package/api-services/modules/file/es5.js +797 -826
- package/api-services/modules/file/index.js +625 -649
- package/api-services/modules/file/index.js.gz +0 -0
- package/api-services/modules/gateway-edge/es5.js +1281 -1297
- package/api-services/modules/gateway-edge/index.js +1063 -1068
- package/api-services/modules/gateway-edge/index.js.gz +0 -0
- package/api-services/modules/index.js +678 -702
- package/api-services/modules/index.js.gz +0 -0
- package/api-services/modules/iot/es5.js +960 -988
- package/api-services/modules/iot/index.js +772 -795
- package/api-services/modules/iot/index.js.gz +0 -0
- package/api-services/modules/justauth/es5.js +1275 -1312
- package/api-services/modules/justauth/index.js +1044 -1081
- package/api-services/modules/justauth/index.js.gz +0 -0
- package/api-services/modules/knowledge/es5.js +733 -761
- package/api-services/modules/knowledge/index.js +572 -595
- package/api-services/modules/knowledge/index.js.gz +0 -0
- package/api-services/modules/link/es5.js +1236 -1276
- package/api-services/modules/link/index.js +1018 -1059
- package/api-services/modules/link/index.js.gz +0 -0
- package/api-services/modules/permission/es5.js +735 -763
- package/api-services/modules/permission/index.js +581 -604
- package/api-services/modules/permission/index.js.gz +0 -0
- package/api-services/modules/platformManage/es5.js +1272 -1288
- package/api-services/modules/platformManage/index.js +1046 -1051
- package/api-services/modules/platformManage/index.js.gz +0 -0
- package/api-services/modules/portal/es5.js +1281 -1297
- package/api-services/modules/portal/index.js +1063 -1068
- package/api-services/modules/portal/index.js.gz +0 -0
- package/api-services/modules/space-manage/es5.js +1282 -1298
- package/api-services/modules/space-manage/index.js +1059 -1064
- package/api-services/modules/space-manage/index.js.gz +0 -0
- package/api-services/modules/super-admin/es5.js +1241 -1281
- package/api-services/modules/super-admin/index.js +1020 -1061
- package/api-services/modules/super-admin/index.js.gz +0 -0
- package/api-services/modules/supplier/es5.js +726 -754
- package/api-services/modules/supplier/index.js +577 -600
- package/api-services/modules/supplier/index.js.gz +0 -0
- package/api-services/modules/supplychain-manage/es5.js +735 -763
- package/api-services/modules/supplychain-manage/index.js +581 -604
- package/api-services/modules/supplychain-manage/index.js.gz +0 -0
- package/api-services/modules/systemConfiguration/es5.js +735 -763
- package/api-services/modules/systemConfiguration/index.js +581 -604
- package/api-services/modules/systemConfiguration/index.js.gz +0 -0
- package/api-services/modules/tool/es5.js +735 -763
- package/api-services/modules/tool/index.js +581 -604
- package/api-services/modules/tool/index.js.gz +0 -0
- package/api-services/src/create-service/es5.js +1279 -1295
- package/api-services/src/create-service/index.js +1062 -1067
- package/api-services/src/create-service/index.js.gz +0 -0
- package/common-info/es5.js +1333 -1373
- package/common-info/getPermissionMethod/es5.js +1517 -1533
- package/common-info/getPermissionMethod/index.js +1257 -1262
- package/common-info/getPermissionMethod/index.js.gz +0 -0
- package/common-info/index.js +1096 -1137
- package/common-info/index.js.gz +0 -0
- package/common-tools/es5.d.ts +1 -0
- package/common-tools/es5.js +9 -0
- package/common-tools/index.d.ts +1 -0
- package/common-tools/index.js +1 -0
- package/common-tools/timezone-format/es5.d.ts +5 -110
- package/common-tools/timezone-format/es5.js +473 -662
- package/common-tools/timezone-format/get-iana-data/dayjs-timezone-iana-plugin.d.ts +72 -0
- package/common-tools/timezone-format/get-iana-data/iana-api-fetch.d.ts +21 -0
- package/common-tools/timezone-format/get-iana-data/moment-iana-loader.d.ts +29 -0
- package/common-tools/timezone-format/index.d.ts +5 -110
- package/common-tools/timezone-format/index.js +328 -446
- package/common-tools/timezone-format/index.js.gz +0 -0
- package/create-api-service/es5.js +980 -1005
- package/create-api-service/index.js +773 -792
- package/create-api-service/index.js.gz +0 -0
- package/esm-map.json +7 -26
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/package.json +3 -3
- package/theme/es5.d.ts +8 -22
- package/theme/es5.js +354 -367
- package/theme/index.d.ts +8 -22
- package/theme/index.js +255 -276
- package/theme/index.js.gz +0 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
export interface TimeZoneRule {
|
|
2
|
+
u: number[];
|
|
3
|
+
o: number[];
|
|
4
|
+
}
|
|
5
|
+
export interface IanaDb {
|
|
6
|
+
[zone: string]: TimeZoneRule;
|
|
7
|
+
}
|
|
8
|
+
/** `dayjs.extend` 时无需传 IANA 数据;须先 `await plugin.preloadFromApi()`(默认请求内置路径并带 accessToken) */
|
|
9
|
+
export type DayjsTimezoneIanaOption = undefined;
|
|
10
|
+
export interface PackedIanaData {
|
|
11
|
+
version?: string;
|
|
12
|
+
zones: string[];
|
|
13
|
+
links?: string[];
|
|
14
|
+
}
|
|
15
|
+
export type ParsePackedIanaResponse = (json: unknown) => PackedIanaData;
|
|
16
|
+
/** 默认 `fetch` 请求的第二个参数;自定义 `fetchJson` 时也会传入 */
|
|
17
|
+
export type IanaFetchJson = (url: string, init?: RequestInit) => Promise<unknown>;
|
|
18
|
+
export interface PreloadDayjsIanaOptions {
|
|
19
|
+
/** 默认 `/api/admin/basic-application/sys-info/v1/license/time-zone-packed-data`;未传则请求内置地址 */
|
|
20
|
+
url?: string;
|
|
21
|
+
/**
|
|
22
|
+
* 设置 `Authorization`;未传时从 `localStorage.getItem('accessToken')` 生成 `Bearer <token>`。
|
|
23
|
+
* 传 `''` 表示不附加鉴权头。
|
|
24
|
+
*/
|
|
25
|
+
authorization?: string;
|
|
26
|
+
/** 额外请求头;与 `authorization` 合并,同名时以 `authorization` 为准 */
|
|
27
|
+
headers?: Record<string, string>;
|
|
28
|
+
/** 默认使用全局 `fetch`;Node 等环境可传入实现 */
|
|
29
|
+
fetchJson?: IanaFetchJson;
|
|
30
|
+
/** 接口外层包裹时在此解析为 `{ version?, zones, links? }` */
|
|
31
|
+
parseResponse?: ParsePackedIanaResponse;
|
|
32
|
+
}
|
|
33
|
+
type DayjsLike = {
|
|
34
|
+
utc: () => DayjsLike;
|
|
35
|
+
valueOf: () => number;
|
|
36
|
+
utcOffset: (offset: number, keepLocalTime?: boolean) => DayjsLike;
|
|
37
|
+
tz: (zone?: string, keepLocalTime?: boolean) => DayjsLike;
|
|
38
|
+
};
|
|
39
|
+
type DayjsClassLike = {
|
|
40
|
+
prototype: {
|
|
41
|
+
tz?: (zone?: string) => DayjsLike;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
type DayjsFactoryLike = {
|
|
45
|
+
(value?: unknown, format?: string): DayjsLike;
|
|
46
|
+
utc?: (value?: unknown, format?: string) => DayjsLike;
|
|
47
|
+
tz?: DayjsTimezoneFactoryLike;
|
|
48
|
+
};
|
|
49
|
+
type DayjsTimezoneFactoryLike = {
|
|
50
|
+
(value?: unknown, timezoneOrFormat?: string, timezone?: string): DayjsLike;
|
|
51
|
+
setDefault?: (zone: string) => void;
|
|
52
|
+
guess?: () => string;
|
|
53
|
+
};
|
|
54
|
+
type DayjsPlugin = (option: DayjsTimezoneIanaOption | undefined, dayjsClass: DayjsClassLike, dayjsFactory: DayjsFactoryLike) => void;
|
|
55
|
+
export type DayjsTimezoneIanaPlugin = DayjsPlugin & {
|
|
56
|
+
/** 请求接口并解析 packed 数据,写入内部缓存;须在 `dayjs.extend(plugin)` 之前 await 完成 */
|
|
57
|
+
preloadFromApi: (options?: PreloadDayjsIanaOptions) => Promise<PackedIanaData>;
|
|
58
|
+
/** 直接写入已获取的 packed 数据,避免业务层为了复用接口结果再发起请求 */
|
|
59
|
+
preloadFromData: (packedData: PackedIanaData) => PackedIanaData;
|
|
60
|
+
/** 返回最近一次写入的 packed 数据,供公共工具同步已知时区集合 */
|
|
61
|
+
getCachedPackedData: () => PackedIanaData | null;
|
|
62
|
+
/** 清空内部缓存(测试或切换数据源时使用) */
|
|
63
|
+
clearIanaCache: () => void;
|
|
64
|
+
};
|
|
65
|
+
export declare function assertPackedIanaData(json: unknown): PackedIanaData;
|
|
66
|
+
export declare function preloadDayjsIanaFromData(packedData: PackedIanaData): PackedIanaData;
|
|
67
|
+
export declare function getCachedDayjsPackedIanaData(): PackedIanaData | null;
|
|
68
|
+
export declare function preloadDayjsIanaFromApi(options?: PreloadDayjsIanaOptions): Promise<PackedIanaData>;
|
|
69
|
+
export declare function clearDayjsIanaCache(): void;
|
|
70
|
+
export declare function createIanaDbFromPackedData(packedData: PackedIanaData): IanaDb;
|
|
71
|
+
declare const plugin: DayjsTimezoneIanaPlugin;
|
|
72
|
+
export default plugin;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 内置 IANA packed 数据接口路径(与网关 / 前端 base 拼接)。
|
|
3
|
+
*/
|
|
4
|
+
export declare const TIME_ZONE_PACKED_DATA_URL: string;
|
|
5
|
+
/**
|
|
6
|
+
* 从浏览器 localStorage 读取 accessToken(非浏览器或无此项时返回 null)。
|
|
7
|
+
*/
|
|
8
|
+
export declare function getAccessTokenFromLocalStorage(): string | null;
|
|
9
|
+
/**
|
|
10
|
+
* 默认 Authorization:`Bearer <accessToken>`;若 token 已含 `Bearer ` 则原样使用。
|
|
11
|
+
*/
|
|
12
|
+
export declare function getDefaultIanaAuthorization(): string | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* 构造 IANA 接口请求的 fetch init(Authorization 与其它头)。
|
|
15
|
+
* - 未传 `authorization` 时,自动使用 `localStorage.getItem('accessToken')` 生成 `Authorization`。
|
|
16
|
+
* - 传入 `authorization: ''` 表示不附加 Authorization(用于测试等场景)。
|
|
17
|
+
*/
|
|
18
|
+
export declare function buildIanaFetchInit(options?: {
|
|
19
|
+
authorization?: string;
|
|
20
|
+
headers?: Record<string, string>;
|
|
21
|
+
}): RequestInit | undefined;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 将接口返回的 packed IANA 数据(与 moment-timezone 数据格式一致)注册到当前 moment 实例上。
|
|
3
|
+
* 业务侧须先:`import moment from 'moment'; import 'moment-timezone';`,再传入同一个 `moment`。
|
|
4
|
+
*/
|
|
5
|
+
export interface PackedIanaTzData {
|
|
6
|
+
version?: string;
|
|
7
|
+
zones: string[];
|
|
8
|
+
links?: string[];
|
|
9
|
+
}
|
|
10
|
+
export interface MomentWithTimezone {
|
|
11
|
+
tz: {
|
|
12
|
+
load: (data: PackedIanaTzData) => void;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export declare function assertPackedIanaTzData(json: unknown): PackedIanaTzData;
|
|
16
|
+
export declare function loadIanaData(moment: MomentWithTimezone, data: PackedIanaTzData): void;
|
|
17
|
+
export type ParseIanaResponse = (json: unknown) => PackedIanaTzData;
|
|
18
|
+
export type IanaMomentFetchJson = (url: string, init?: RequestInit) => Promise<unknown>;
|
|
19
|
+
export interface LoadIanaFromApiOptions {
|
|
20
|
+
/** 设置请求头 `Authorization`(完整值,如 `Bearer <token>`) */
|
|
21
|
+
authorization?: string;
|
|
22
|
+
/** 额外请求头;与 `authorization` 合并,同名时以 `authorization` 为准 */
|
|
23
|
+
headers?: Record<string, string>;
|
|
24
|
+
/** 自定义请求,默认使用全局 fetch */
|
|
25
|
+
fetchJson?: IanaMomentFetchJson;
|
|
26
|
+
/** 当接口外层有包裹时,在此取出 { version, zones, links } */
|
|
27
|
+
parseResponse?: ParseIanaResponse;
|
|
28
|
+
}
|
|
29
|
+
export declare function loadIanaFromApi(moment: MomentWithTimezone, urlOrOptions?: string | LoadIanaFromApiOptions, maybeOptions?: LoadIanaFromApiOptions): Promise<PackedIanaTzData>;
|
|
@@ -1,80 +1,9 @@
|
|
|
1
1
|
import { Dayjs } from 'dayjs';
|
|
2
|
+
import { default as dayjsTimezoneIanaPlugin, PackedIanaData, PreloadDayjsIanaOptions } from './get-iana-data/dayjs-timezone-iana-plugin';
|
|
3
|
+
import { loadIanaData as loadMomentIanaData, loadIanaFromApi as loadMomentIanaFromApi, LoadIanaFromApiOptions, MomentWithTimezone, PackedIanaTzData } from './get-iana-data/moment-iana-loader';
|
|
2
4
|
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
o: number[];
|
|
6
|
-
}
|
|
7
|
-
export interface IanaDb {
|
|
8
|
-
[zone: string]: TimeZoneRule;
|
|
9
|
-
}
|
|
10
|
-
export type DayjsTimezoneIanaOption = undefined;
|
|
11
|
-
export interface PackedIanaData {
|
|
12
|
-
version?: string;
|
|
13
|
-
zones: string[];
|
|
14
|
-
links?: string[];
|
|
15
|
-
}
|
|
16
|
-
export type ParsePackedIanaResponse = (json: unknown) => PackedIanaData;
|
|
17
|
-
export type IanaFetchJson = (url: string, init?: RequestInit) => Promise<unknown>;
|
|
18
|
-
export interface PreloadDayjsIanaOptions {
|
|
19
|
-
/** 默认请求内置 IANA packed 数据接口;可传自定义地址覆盖。 */
|
|
20
|
-
url?: string;
|
|
21
|
-
/** 设置 Authorization;传空字符串表示不附加鉴权头。 */
|
|
22
|
-
authorization?: string;
|
|
23
|
-
/** 额外请求头;与 authorization 合并,同名时以 authorization 为准。 */
|
|
24
|
-
headers?: Record<string, string>;
|
|
25
|
-
/** 默认使用全局 fetch;Node 等环境可传入实现。 */
|
|
26
|
-
fetchJson?: IanaFetchJson;
|
|
27
|
-
/** 接口外层包裹时在此解析为 packed IANA 数据。 */
|
|
28
|
-
parseResponse?: ParsePackedIanaResponse;
|
|
29
|
-
}
|
|
30
|
-
export type DayjsTimezoneIanaPlugin = ((option?: DayjsTimezoneIanaOption, dayjsClass?: unknown, dayjsFactory?: unknown) => void) & {
|
|
31
|
-
preloadFromApi: (options?: PreloadDayjsIanaOptions) => Promise<PackedIanaData>;
|
|
32
|
-
preloadFromData: (packedData: PackedIanaData) => PackedIanaData;
|
|
33
|
-
getCachedPackedData: () => PackedIanaData | null;
|
|
34
|
-
clearIanaCache: () => void;
|
|
35
|
-
};
|
|
36
|
-
export interface PackedIanaTzData {
|
|
37
|
-
version?: string;
|
|
38
|
-
zones: string[];
|
|
39
|
-
links?: string[];
|
|
40
|
-
}
|
|
41
|
-
export type MomentTimezoneApi = {
|
|
42
|
-
load: (data: PackedIanaTzData) => void;
|
|
43
|
-
};
|
|
44
|
-
export interface MomentWithTimezone {
|
|
45
|
-
tz: MomentTimezoneApi | (((...args: any[]) => unknown) & MomentTimezoneApi);
|
|
46
|
-
}
|
|
47
|
-
export type ParseIanaResponse = (json: unknown) => PackedIanaTzData;
|
|
48
|
-
export type IanaMomentFetchJson = (url: string, init?: RequestInit) => Promise<unknown>;
|
|
49
|
-
export interface LoadIanaFromApiOptions {
|
|
50
|
-
/** 设置请求头 Authorization。 */
|
|
51
|
-
authorization?: string;
|
|
52
|
-
/** 额外请求头;与 authorization 合并,同名时以 authorization 为准。 */
|
|
53
|
-
headers?: Record<string, string>;
|
|
54
|
-
/** 自定义请求,默认使用全局 fetch。 */
|
|
55
|
-
fetchJson?: IanaMomentFetchJson;
|
|
56
|
-
/** 当接口外层有包裹时,在此取出 packed IANA 数据。 */
|
|
57
|
-
parseResponse?: ParseIanaResponse;
|
|
58
|
-
}
|
|
59
|
-
export declare const dayjsTimezoneIanaPlugin: DayjsTimezoneIanaPlugin;
|
|
60
|
-
export declare const assertPackedIanaData: (json: unknown) => PackedIanaData;
|
|
61
|
-
export declare const preloadDayjsIanaFromData: (packedData: PackedIanaData) => PackedIanaData;
|
|
62
|
-
export declare const getCachedDayjsPackedIanaData: () => PackedIanaData | null;
|
|
63
|
-
export declare const preloadDayjsIanaFromApi: (options?: PreloadDayjsIanaOptions) => Promise<PackedIanaData>;
|
|
64
|
-
export declare const clearDayjsIanaCache: () => void;
|
|
65
|
-
export declare const createIanaDbFromPackedData: (packedData: PackedIanaData) => IanaDb;
|
|
66
|
-
export declare const TIME_ZONE_PACKED_DATA_URL: string;
|
|
67
|
-
export declare const getAccessTokenFromLocalStorage: () => string | null;
|
|
68
|
-
export declare const getDefaultIanaAuthorization: () => string | undefined;
|
|
69
|
-
export declare const buildIanaFetchInit: (options?: {
|
|
70
|
-
authorization?: string;
|
|
71
|
-
headers?: Record<string, string>;
|
|
72
|
-
}) => RequestInit | undefined;
|
|
73
|
-
export declare const assertPackedIanaTzData: (json: unknown) => PackedIanaTzData;
|
|
74
|
-
export declare const loadMomentIanaData: (moment: MomentWithTimezone, data: PackedIanaTzData) => void;
|
|
75
|
-
export declare const loadIanaData: (moment: MomentWithTimezone, data: PackedIanaTzData) => void;
|
|
76
|
-
export declare const loadMomentIanaFromApi: (moment: MomentWithTimezone, urlOrOptions?: string | LoadIanaFromApiOptions, maybeOptions?: LoadIanaFromApiOptions) => Promise<PackedIanaTzData>;
|
|
77
|
-
export declare const loadIanaFromApi: (moment: MomentWithTimezone, urlOrOptions?: string | LoadIanaFromApiOptions, maybeOptions?: LoadIanaFromApiOptions) => Promise<PackedIanaTzData>;
|
|
5
|
+
export * from './get-iana-data';
|
|
6
|
+
export { dayjsTimezoneIanaPlugin, loadMomentIanaData, loadMomentIanaFromApi };
|
|
78
7
|
export type TimeValue = string | number | Date | Dayjs | null | undefined;
|
|
79
8
|
export type TimeZoneFlag = number | string | null | undefined;
|
|
80
9
|
export type TimeZoneDateLibrary = 'dayjs' | 'moment';
|
|
@@ -165,21 +94,9 @@ export interface FormatLocalDateTimeOptions {
|
|
|
165
94
|
/** 未传 timeZone 时是否读取 sessionStorage/客户端时区。默认 false,兼容旧 toLocalDate。 */
|
|
166
95
|
useClientTimeZone?: boolean;
|
|
167
96
|
}
|
|
168
|
-
export interface FormatLocalDateTimeIntlOptions {
|
|
169
|
-
/** 目标 IANA 时区;为空时读取浏览器当前时区。 */
|
|
170
|
-
timeZone?: string | null;
|
|
171
|
-
/** 输出格式,默认 YYYY-MM-DD HH:mm:ss。 */
|
|
172
|
-
format?: string;
|
|
173
|
-
/** Intl locale,默认 zh-CN,保证中后台测试文案稳定。 */
|
|
174
|
-
locale?: string;
|
|
175
|
-
}
|
|
176
97
|
export interface ApplyIanaTimeZoneOptions {
|
|
177
98
|
/** 指定默认时区,后续 dayjs.tz(value) 可直接使用。 */
|
|
178
99
|
defaultTimeZone?: string;
|
|
179
|
-
/** 运行期快照来源:接口数据为 iana,随包数据或本地兜底为 fallback。 */
|
|
180
|
-
runtimeSource?: IanaTimeZoneDataSource;
|
|
181
|
-
/** 是否把 packed 数据写到 window 快照,供 iframe 子应用复用。默认 true。 */
|
|
182
|
-
writeRuntimeSnapshot?: boolean;
|
|
183
100
|
}
|
|
184
101
|
export interface LoadIanaTimeZoneOptions extends PreloadDayjsIanaOptions, ApplyIanaTimeZoneOptions {
|
|
185
102
|
}
|
|
@@ -187,11 +104,6 @@ export interface ApplyIanaTimeZoneResult {
|
|
|
187
104
|
data: PackedIanaData;
|
|
188
105
|
knownTimeZones: string[];
|
|
189
106
|
}
|
|
190
|
-
export type IanaTimeZoneDataSource = 'iana' | 'fallback';
|
|
191
|
-
export interface RuntimeIanaTimeZoneDataSnapshot extends PackedIanaData {
|
|
192
|
-
source: IanaTimeZoneDataSource;
|
|
193
|
-
timestamp: number;
|
|
194
|
-
}
|
|
195
107
|
export interface LoadMomentIanaTimeZoneOptions extends LoadIanaFromApiOptions {
|
|
196
108
|
url?: string;
|
|
197
109
|
}
|
|
@@ -214,21 +126,9 @@ export interface SetClientTimeZoneOptions {
|
|
|
214
126
|
source?: string;
|
|
215
127
|
}
|
|
216
128
|
export type ClientTimeZoneChangeHandler = (timeZone: string, detail: ClientTimeZoneChangeDetail) => void;
|
|
217
|
-
export interface ClientTimeZoneRef {
|
|
218
|
-
/** 框架无关的当前时区快照;Vue/Angular/原生应用都可直接读取。 */
|
|
219
|
-
value: string;
|
|
220
|
-
}
|
|
221
129
|
export declare const TIMEZONE_CHANGE_EVENT = "timezonechange";
|
|
222
130
|
export declare const UPF_TIMEZONE_MESSAGE_TYPE = "__UPF_TIMEZONE_CHANGE__";
|
|
223
|
-
export declare const
|
|
224
|
-
export declare const IANA_TIMEZONE_DATA_CHANGE_EVENT = "ianatimezonedatachange";
|
|
225
|
-
export declare const setRuntimeIanaTimeZoneDataSnapshot: (data: PackedIanaData, options?: {
|
|
226
|
-
source?: IanaTimeZoneDataSource;
|
|
227
|
-
dispatchEvent?: boolean;
|
|
228
|
-
}) => RuntimeIanaTimeZoneDataSnapshot | null;
|
|
229
|
-
export declare const getRuntimeIanaTimeZoneDataSnapshot: () => RuntimeIanaTimeZoneDataSnapshot | null;
|
|
230
|
-
export declare const readInjectedParentIanaTimeZoneDataSnapshot: () => RuntimeIanaTimeZoneDataSnapshot | null;
|
|
231
|
-
export declare const clientTimeZone: ClientTimeZoneRef;
|
|
131
|
+
export declare const clientTimeZone: any;
|
|
232
132
|
export declare const isKnownTimeZone: (timeZone?: string | null) => any;
|
|
233
133
|
export declare const rebuildKnownTimeZoneIds: (data: Pick<PackedIanaData, "zones" | "links">) => any;
|
|
234
134
|
export declare const getKnownTimeZoneIds: () => any;
|
|
@@ -237,7 +137,6 @@ export declare const loadDayjsIanaTimeZoneData: (options?: LoadIanaTimeZoneOptio
|
|
|
237
137
|
export declare const applyMomentIanaTimeZoneData: (moment: MomentWithTimezone, data: PackedIanaTzData) => PackedIanaTzData;
|
|
238
138
|
export declare const loadMomentIanaTimeZoneData: (moment: MomentWithTimezone, options?: LoadMomentIanaTimeZoneOptions) => unknown;
|
|
239
139
|
export declare const setDefaultTimeZone: (timeZone?: string | null) => boolean;
|
|
240
|
-
export declare const ensureInjectedIanaTimeZoneData: () => Promise<ApplyIanaTimeZoneResult | null>;
|
|
241
140
|
export declare const setClientTimeZone: (timeZone?: string | null, options?: SetClientTimeZoneOptions) => any;
|
|
242
141
|
export declare const syncClientTimeZone: (source?: string) => any;
|
|
243
142
|
export declare const onClientTimeZoneChange: (handler: ClientTimeZoneChangeHandler) => () => any;
|
|
@@ -249,9 +148,6 @@ export declare const getZoneUtcOffset: (value: TimeValue, timeZone?: string | nu
|
|
|
249
148
|
export declare const formatInTimeZone: (value?: TimeValue, timeZone?: string | null, format?: string) => any;
|
|
250
149
|
export declare const formatLocalDateTime: (value?: TimeValue, options?: FormatLocalDateTimeOptions | string) => string;
|
|
251
150
|
export declare const toLocalDate: (value?: TimeValue, format?: string, options?: Omit<FormatLocalDateTimeOptions, "format">) => string;
|
|
252
|
-
export declare const getBrowserTimeZone: () => any;
|
|
253
|
-
export declare function formatLocalDateTimeIntl(value?: TimeValue, timeZone?: string | null, format?: string, locale?: string): string;
|
|
254
|
-
export declare function formatLocalDateTimeIntl(value?: TimeValue, options?: FormatLocalDateTimeIntlOptions): string;
|
|
255
151
|
export declare const formatTimeZoneOffsetLabel: (value?: TimeValue, timeZone?: string | null) => string;
|
|
256
152
|
export declare const resolveUtcOffsetFallback: (option: Pick<TimeZoneOption, "timeZoneId" | "baseUtcOffsetText" | "currentUtcOffsetText">, referenceDate?: Date) => string;
|
|
257
153
|
export declare const timeZoneHasDST: (timeZone?: string | null, value?: TimeValue) => boolean;
|
|
@@ -260,4 +156,3 @@ export declare const isDaylightSavingTime: (timeZone?: string | null, value?: Ti
|
|
|
260
156
|
export declare const buildTimeZoneDisplayOptions: (options: TimeZoneOption[], referenceDate?: Date) => TimeZoneDisplayOption[];
|
|
261
157
|
export declare const formatClientLocalDateTimeLine: (value: TimeValue, timeZone?: string | null, options?: FormatClientLocalDateTimeLineOptions) => any;
|
|
262
158
|
export declare const getTimeZoneDisplayInfo: (options?: TimeZoneDisplayOptions) => TimeZoneDisplayResult;
|
|
263
|
-
export {};
|