@cloudbase/cals 0.5.12 → 0.5.13
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.
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const wedaDTS = "\ndeclare class UserWidget {\n // FIXME: \u6682\u65F6\u4E0D\u5BF9\u5916\u66B4\u9732\n // \u5185\u7F6E\u547D\u540D\u7A7A\u95F4\n // get sys(): {\n // readonly id: string;\n // readonly module: string;\n // readonly component: string;\n // readonly parent: UserWidget;\n // readonly children: UserWidget[];\n\n // closest(filter?: (parentWidget: UserWidget) => boolean): UserWidget | null;\n // };\n\n // FIXME: \u6682\u65F6\u4E0D\u5BF9\u5916\u66B4\u9732\n // \u81EA\u5B9A\u4E49\u547D\u540D\u7A7A\u95F4\n // get custom(): { [key: string]: any };\n\n // ========== \u5FEB\u6377\u8BBF\u95EE\u65B9\u5F0F ========== //\n\n /**\n * \u7EC4\u4EF6 id\n */\n readonly id: string;\n /**\n * \u7EC4\u4EF6\u5E93\u540D\u79F0\n */\n readonly module: string;\n /**\n * \u7EC4\u4EF6\u540D\u79F0\n */\n readonly component: string;\n // FIXME: \u6682\u65F6\u4E0D\u5BF9\u5916\u66B4\u9732\n // readonly parent: UserWidget;\n // readonly children: UserWidget[];\n\n // closest(filter?: (parentWidget: UserWidget) => boolean): UserWidget | null;\n}\n\n// Used Components Inner Begin\n// Used Components - Don't touch me\n// Used Components Inner End\n\ndeclare namespace $app {\n namespace dataset {\n\n const state: {\n // Global State Inner Begin\n // Global State \u5168\u5C40\u53D8\u91CF - Don't touch me\n // Global State Inner End\n }\n\n }\n\n namespace utils {\n function ABS(num: number): number;\n function Min(...args: number[]): number;\n function Max(...args: number[]): number;\n function Average(...args: number[]): number;\n function Floor(num: number): number;\n function Ceiling(num: number): number;\n function Round(num: number): number;\n function Sum(...args: number[]): number;\n function Rand(num: number): number;\n\n function If(condition: boolean, val1: any, val2: any): any;\n function IsEmpty(text: string | string[]): boolean;\n function NotNull(val: any): boolean;\n function And(...args: boolean[]): boolean;\n function Or(...args: boolean[]): boolean;\n\n function Len(text: string): number;\n function Contains(text1: string, text2: string): boolean;\n function Split(text1: string, text2: string): string[];\n function Trim(text: string): string;\n function Upper(text: string): string;\n function Lower(text: string): string;\n function Concat(...text: string[]): string;\n\n function Now(): number;\n function Timestamp(arg: number | string | Date): number;\n function Second(arg: number | string | Date): number;\n function Minute(arg: number | string | Date): number;\n function Hour(arg: number | string | Date): number;\n function Day(arg: number | string | Date): number;\n function DayOfWeek(arg: number | string | Date): number;\n function Month(arg: number | string | Date): number;\n function Year(arg: number | string | Date): number;\n function GetDate(year: number, month: number, day: number): number;\n function DateTimeValue(arg: string, val: string): number;\n function Age(arg: number | string | Date, val: number | string | Date): number;\n function AgeOfNow(arg: number | string | Date): number;\n function DateAdd(arg: number | string | Date, day: number): number;\n function MonthAdd(arg: number | string | Date, month: number): number;\n function YearAdd(arg: number | string | Date, year: number): number;\n function DateDiff(startDay: number | string | Date, endDay: number | string | Date): number;\n function HourDiff(startDay: number | string | Date, endDay: number | string | Date): number;\n function MinuteDiff(startDay: number | string | Date, endDay: number | string | Date): number;\n function SecondDiff(startDay: number | string | Date, endDay: number | string | Date): number;\n function MonthDiff(startDay: number | string | Date, endDay: number | string | Date): number;\n function YearDiff(startDay: number | string | Date, endDay: number | string | Date): number;\n function DateText(createdTime: number | string | Date, text: string): string;\n function IsToday(date: number | string | Date): boolean;\n\n }\n\n namespace common {\n // Global Common Inner Begin\n // Global Common \u5168\u5C40\u65B9\u6CD5 - Don't touch me\n // Global Common Inner End\n }\n\n namespace auth {\n const currentUser: {\n userId?: string\n phone?: string\n type?: number\n relatedRoles?: {\n id?: string\n envId?: string\n name?: string\n roleIdentity?: string\n }[]\n openId?: string\n name?: string\n nickName?: string\n email?: string\n mainOrg?: {\n id?: string\n name?: string\n }\n orgs?: {\n id?: string\n name?: string\n }[]\n}\n\n }\n\n \n\ninterface navigatorOptions {\n packageName: string;\n pageId: string;\n data?: Record<string, any>;\n params?: Record<string, any>;\n events?: Record<string, (data: any) => void>;\n success(res: any);\n fail(res: any);\n complete(res: any);\n}\n\ninterface navigateBackOptions {\n delta: number;\n}\n\n// \u8BBE\u7F6E\u72B6\u6001\nfunction setState(userSetState: Record<string, any>): void\n\n// \u7279\u5236\u8DEF\u7531\nfunction navigateTo(options: navigatorOptions)\nfunction redirectTo(options: navigatorOptions)\nfunction reLaunch(options: navigatorOptions)\nfunction navigateBack(options: navigateBackOptions)\n\n// \u663E\u793A\u63D0\u793A\nfunction showToast(options);\n\n// \u663E\u793A\u6A21\u6001\u63D0\u793A\nfunction showModal(options);\n\n// \u663E\u793A loading \u63D0\u793A\nfunction showLoading(options);\n\n// \u9690\u85CF loading \u63D0\u793A\nfunction hideLoading(options);\n\n// \u9690\u85CF\u63D0\u793A\nfunction hideToast(options);\n\n// sacnCode\nfunction scanCode(options: {\n onlyFromCamera?: boolean;\n enableDefaultBehavior?: boolean;\n scanType?: ('barCode' | 'qrCode')[];\n success?: (res: { result: string; scanType: string }) => void;\n fail?: (err: Error) => void;\n complete?: () => void;\n}): Promise<ScanCodeResult> | ScanCodeResult;\n\n\n}\n\ndeclare const app = $app\n\ndeclare namespace $w {\n function ABS(num: number): number;\n function Min(...args: number[]): number;\n function Max(...args: number[]): number;\n function Average(...args: number[]): number;\n function Floor(num: number): number;\n function Ceiling(num: number): number;\n function Round(num: number): number;\n function Sum(...args: number[]): number;\n function Rand(num: number): number;\n\n function If(condition: boolean, val1: any, val2: any): any;\n function IsEmpty(text: string | string[]): boolean;\n function NotNull(val: any): boolean;\n function And(...args: boolean[]): boolean;\n function Or(...args: boolean[]): boolean;\n\n function Len(text: string): number;\n function Contains(text1: string, text2: string): boolean;\n function Split(text1: string, text2: string): string[];\n function Trim(text: string): string;\n function Upper(text: string): string;\n function Lower(text: string): string;\n function Concat(...text: string[]): string;\n\n function Now(): number;\n function Timestamp(arg: number | string | Date): number;\n function Second(arg: number | string | Date): number;\n function Minute(arg: number | string | Date): number;\n function Hour(arg: number | string | Date): number;\n function Day(arg: number | string | Date): number;\n function DayOfWeek(arg: number | string | Date): number;\n function Month(arg: number | string | Date): number;\n function Year(arg: number | string | Date): number;\n function GetDate(year: number, month: number, day: number): number;\n function DateTimeValue(arg: string, val: string): number;\n function Age(arg: number | string | Date, val: number | string | Date): number;\n function AgeOfNow(arg: number | string | Date): number;\n function DateAdd(arg: number | string | Date, day: number): number;\n function MonthAdd(arg: number | string | Date, month: number): number;\n function YearAdd(arg: number | string | Date, year: number): number;\n function DateDiff(startDay: number | string | Date, endDay: number | string | Date): number;\n function HourDiff(startDay: number | string | Date, endDay: number | string | Date): number;\n function MinuteDiff(startDay: number | string | Date, endDay: number | string | Date): number;\n function SecondDiff(startDay: number | string | Date, endDay: number | string | Date): number;\n function MonthDiff(startDay: number | string | Date, endDay: number | string | Date): number;\n function YearDiff(startDay: number | string | Date, endDay: number | string | Date): number;\n function DateText(createdTime: number | string | Date, text: string): string;\n function IsToday(date: number | string | Date): boolean;\n\n\n // used widgets Inner Begin\n // used widgets - Don't touch me\n // used widgets Inner End\n\n // repeater scope Inner Begin\n // repeater scope - Don't touch me\n // repeater scope Inner End\n}\n\n// Global For Begin\ndeclare const $for: {\n // Global For Inner Begin\n // For \u5FAA\u73AF\u53D8\u91CF - Don't touch me\n // Global For Inner End\n}\ndeclare const forItems = $for\n// Global For End\n\n// $page Begin\ndeclare namespace $page {\n namespace dataset {\n\n const state: {\n // Page State Inner Begin\n // Page State \u9875\u9762\u53D8\u91CF - Don't touch me\n // Page State Inner End\n }\n\n const params: {\n // Page Param Inner Begin\n // Page Param \u9875\u9762\u53C2\u6570 - Don't touch me\n // Page Param Inner End\n }\n\n }\n\n namespace handler {\n // Page Handler Inner Begin\n // Page Handler \u9875\u9762\u65B9\u6CD5 - Don't touch me\n // Page Handler Inner End\n }\n\n \n\n// \u8BBE\u7F6E\u72B6\u6001\nfunction setState(userSetState: Record<string, any>): void\n\n\n}\n// $page End\n\n// $comp Begin\ndeclare namespace $comp {\n\n namespace props {\n\n const data: {\n // Comp Prop Data Inner Begin\n // Comp Prop Data \u7EC4\u4EF6\u5C5E\u6027 - Don't touch me\n // Comp Prop Data Inner End\n }\n\n namespace events {\n // Comp Prop Events Inner Begin\n // Comp Prop Events \u7EC4\u4EF6\u4E8B\u4EF6 - Don't touch me\n // Comp Prop Events Inner End\n }\n\n }\n\n namespace dataset {\n\n const state: {\n // Comp State Inner Begin\n // Comp State \u7EC4\u4EF6\u53D8\u91CF - Don't touch me\n // Comp State Inner End\n }\n\n }\n\n namespace handler {\n // Comp Handler Inner Begin\n // Comp Handler \u7EC4\u4EF6\u65B9\u6CD5 - Don't touch me\n // Comp Handler Inner End\n }\n\n}\n// $comp End\n\n// Global Formula Begin\n\ndeclare function ABS(num: number): number;\ndeclare function Min(...args: number[]): number;\ndeclare function Max(...args: number[]): number;\ndeclare function Average(...args: number[]): number;\ndeclare function Floor(num: number): number;\ndeclare function Ceiling(num: number): number;\ndeclare function Round(num: number): number;\ndeclare function Sum(...args: number[]): number;\ndeclare function Rand(num: number): number;\n\ndeclare function If(condition: boolean, val1: any, val2: any): any;\ndeclare function IsEmpty(text: string | string[]): boolean;\ndeclare function NotNull(val: any): boolean;\ndeclare function And(...args: boolean[]): boolean;\ndeclare function Or(...args: boolean[]): boolean;\n\ndeclare function Len(text: string): number;\ndeclare function Contains(text1: string, text2: string): boolean;\ndeclare function Split(text1: string, text2: string): string[];\ndeclare function Trim(text: string): string;\ndeclare function Upper(text: string): string;\ndeclare function Lower(text: string): string;\ndeclare function Concat(...text: string[]): string;\n\ndeclare function Now(): number;\ndeclare function Timestamp(arg: number | string | Date): number;\ndeclare function Second(arg: number | string | Date): number;\ndeclare function Minute(arg: number | string | Date): number;\ndeclare function Hour(arg: number | string | Date): number;\ndeclare function Day(arg: number | string | Date): number;\ndeclare function DayOfWeek(arg: number | string | Date): number;\ndeclare function Month(arg: number | string | Date): number;\ndeclare function Year(arg: number | string | Date): number;\ndeclare function GetDate(year: number, month: number, day: number): number;\ndeclare function DateTimeValue(arg: string, val: string): number;\ndeclare function Age(arg: number | string | Date, val: number | string | Date): number;\ndeclare function AgeOfNow(arg: number | string | Date): number;\ndeclare function DateAdd(arg: number | string | Date, day: number): number;\ndeclare function MonthAdd(arg: number | string | Date, month: number): number;\ndeclare function YearAdd(arg: number | string | Date, year: number): number;\ndeclare function DateDiff(startDay: number | string | Date, endDay: number | string | Date): number;\ndeclare function HourDiff(startDay: number | string | Date, endDay: number | string | Date): number;\ndeclare function MinuteDiff(startDay: number | string | Date, endDay: number | string | Date): number;\ndeclare function SecondDiff(startDay: number | string | Date, endDay: number | string | Date): number;\ndeclare function MonthDiff(startDay: number | string | Date, endDay: number | string | Date): number;\ndeclare function YearDiff(startDay: number | string | Date, endDay: number | string | Date): number;\ndeclare function DateText(createdTime: number | string | Date, text: string): string;\ndeclare function IsToday(date: number | string | Date): boolean;\n\n\n// Global Formula End\n";
|
|
1
|
+
export declare const wedaDTS = "declare class UserWidget {\n // FIXME: \u6682\u65F6\u4E0D\u5BF9\u5916\u66B4\u9732\n // \u5185\u7F6E\u547D\u540D\u7A7A\u95F4\n // get sys(): {\n // readonly id: string;\n // readonly module: string;\n // readonly component: string;\n // readonly parent: UserWidget;\n // readonly children: UserWidget[];\n\n // closest(filter?: (parentWidget: UserWidget) => boolean): UserWidget | null;\n // };\n\n // FIXME: \u6682\u65F6\u4E0D\u5BF9\u5916\u66B4\u9732\n // \u81EA\u5B9A\u4E49\u547D\u540D\u7A7A\u95F4\n // get custom(): { [key: string]: any };\n\n // ========== \u5FEB\u6377\u8BBF\u95EE\u65B9\u5F0F ========== //\n\n /**\n * \u7EC4\u4EF6 id\n */\n readonly id: string;\n /**\n * \u7EC4\u4EF6\u5E93\u540D\u79F0\n */\n readonly module: string;\n /**\n * \u7EC4\u4EF6\u540D\u79F0\n */\n readonly component: string;\n // FIXME: \u6682\u65F6\u4E0D\u5BF9\u5916\u66B4\u9732\n // readonly parent: UserWidget;\n // readonly children: UserWidget[];\n\n // closest(filter?: (parentWidget: UserWidget) => boolean): UserWidget | null;\n}\n\n// Used Components Inner Begin\n// Used Components - Don't touch me\n// Used Components Inner End\n\ndeclare namespace $app {\n namespace dataset {\n const state: {\n // Global State Inner Begin\n // Global State \u5168\u5C40\u53D8\u91CF - Don't touch me\n // Global State Inner End\n };\n}\n\nnamespace common {\n // Global Common Inner Begin\n // Global Common \u5168\u5C40\u65B9\u6CD5 - Don't touch me\n // Global Common Inner End\n}\n\nfunction setState(data: Object): void;\n\n}\n\ndeclare const app = $app;\n\ndeclare namespace $w {\n const app = $app;\n\n const page = $page;\n\n namespace auth {\n interface CurrentUserInfo {\n userId?: string;\n phone?: string;\n type?: number;\n relatedRoles?: {\n id?: string;\n envId?: string;\n name?: string;\n roleIdentity?: string;\n }[];\n openId?: string;\n name?: string;\n nickName?: string;\n email?: string;\n mainOrg?: {\n id?: string;\n name?: string;\n };\n orgs?: {\n id?: string;\n name?: string;\n }[];\n}\nfunction getUserInfo(): CurrentUserInfo;\nconst currentUser: CurrentUserInfo;\n\n }\n\n namespace cloud {\n interface ICallDataSourceParams {\n dataSourceName: string;\n methodName: string;\n params: Object;\n}\ninterface ICallFunctionParams {\n name: string;\n data?: any;\n}\ninterface IParseOptions {\n unwrapResult?: boolean;\n parseBusinessInfo?: boolean;\n}\ninterface ICallWorkflowParams {\n action: string;\n data?: Record<string, any>;\n capitalizeDataKey?: boolean;\n}\n\nfunction callDataSource(params: ICallDataSourceParams): any;\nfunction getTempFileURL(params: string | string[]): Promise<string | string[]>;\nfunction callWorkflow(action: ICallWorkflowParams): Promise<any>;\nfunction callFunction(params: ICallFunctionParams, parseOptions?: IParseOptions): Promise<any>;\nfunction getCloudInstance(): Promise<CloudInstance>;\n\n }\n\n // $w.utils\n namespace utils {\n interface navigatorOptions {\n packageName: string;\n pageId: string;\n data?: Record<string, any>;\n params?: Record<string, any>;\n events?: Record<string, (data: any) => void>;\n success(res: any);\n fail(res: any);\n complete(res: any);\n}\n\ninterface navigateBackOptions {\n delta: number;\n}\n\n// \u663E\u793A\u63D0\u793A\nfunction showToast(options);\n\n// \u663E\u793A loading \u63D0\u793A\nfunction showLoading(options);\n\n// \u9690\u85CF loading \u63D0\u793A\nfunction hideLoading(options);\n\n// \u663E\u793A\u6A21\u6001\u63D0\u793A\nfunction showModal(options);\n\n// \u62E8\u6253\u7535\u8BDD\nfunction callPhone(options);\n\n// sacnCode\nfunction scanCode(options: {\n onlyFromCamera?: boolean;\n enableDefaultBehavior?: boolean;\n scanType?: ('barCode' | 'qrCode')[];\n success?: (res: { result: string; scanType: string }) => void;\n fail?: (err: Error) => void;\n complete?: () => void;\n}): Promise<ScanCodeResult> | ScanCodeResult;\n\n// \u7279\u5236\u8DEF\u7531\nfunction navigateTo(options: navigatorOptions);\n\nfunction redirectTo(options: navigatorOptions);\n\nfunction reLaunch(options: navigatorOptions);\n\nfunction relaunchHome();\n\nfunction navigateBack(options: navigateBackOptions);\n\n }\n\n function ABS(num: number): number;\n function Min(...args: number[]): number;\n function Max(...args: number[]): number;\n function Average(...args: number[]): number;\n function Floor(num: number): number;\n function Ceiling(num: number): number;\n function Round(num: number): number;\n function Sum(...args: number[]): number;\n function Rand(num: number): number;\n\n function If(condition: boolean, val1: any, val2: any): any;\n function IsEmpty(text: string | string[]): boolean;\n function NotNull(val: any): boolean;\n function And(...args: boolean[]): boolean;\n function Or(...args: boolean[]): boolean;\n\n function Len(text: string): number;\n function Contains(text1: string, text2: string): boolean;\n function Split(text1: string, text2: string): string[];\n function Trim(text: string): string;\n function Upper(text: string): string;\n function Lower(text: string): string;\n function Concat(...text: string[]): string;\n\n function Now(): number;\n function Timestamp(arg: number | string | Date): number;\n function Second(arg: number | string | Date): number;\n function Minute(arg: number | string | Date): number;\n function Hour(arg: number | string | Date): number;\n function Day(arg: number | string | Date): number;\n function DayOfWeek(arg: number | string | Date): number;\n function Month(arg: number | string | Date): number;\n function Year(arg: number | string | Date): number;\n function GetDate(year: number, month: number, day: number): number;\n function DateTimeValue(arg: string, val: string): number;\n function Age(arg: number | string | Date, val: number | string | Date): number;\n function AgeOfNow(arg: number | string | Date): number;\n function DateAdd(arg: number | string | Date, day: number): number;\n function MonthAdd(arg: number | string | Date, month: number): number;\n function YearAdd(arg: number | string | Date, year: number): number;\n function DateDiff(startDay: number | string | Date, endDay: number | string | Date): number;\n function HourDiff(startDay: number | string | Date, endDay: number | string | Date): number;\n function MinuteDiff(startDay: number | string | Date, endDay: number | string | Date): number;\n function SecondDiff(startDay: number | string | Date, endDay: number | string | Date): number;\n function MonthDiff(startDay: number | string | Date, endDay: number | string | Date): number;\n function YearDiff(startDay: number | string | Date, endDay: number | string | Date): number;\n function DateText(createdTime: number | string | Date, text: string): string;\n function IsToday(date: number | string | Date): boolean;\n\n\n // used widgets Inner Begin\n // used widgets - Don't touch me\n // used widgets Inner End\n\n // repeater scope Inner Begin\n // repeater scope - Don't touch me\n // repeater scope Inner End\n}\n\n// Global For Begin\ndeclare const $for: {\n // Global For Inner Begin\n // For \u5FAA\u73AF\u53D8\u91CF - Don't touch me\n // Global For Inner End\n}\ndeclare const forItems = $for\n// Global For End\n\n// $page Begin\ndeclare namespace $page {\n const id: string;\n\nnamespace dataset {\n const state: {\n // Page State Inner Begin\n // Page State \u9875\u9762\u53D8\u91CF - Don't touch me\n // Page State Inner End\n };\n const params: {\n // Page Param Inner Begin\n // Page Param \u9875\u9762\u53C2\u6570 - Don't touch me\n // Page Param Inner End\n };\n}\nnamespace handler {\n // Page Handler Inner Begin\n // Page Handler \u9875\u9762\u65B9\u6CD5 - Don't touch me\n // Page Handler Inner End\n}\n\nfunction setState(userSetState: Record<string, any>): void;\n\n}\n// $page End\n\n// $comp Begin\ndeclare namespace $comp {\n\n namespace props {\n\n const data: {\n // Comp Prop Data Inner Begin\n // Comp Prop Data \u7EC4\u4EF6\u5C5E\u6027 - Don't touch me\n // Comp Prop Data Inner End\n }\n\n namespace events {\n // Comp Prop Events Inner Begin\n // Comp Prop Events \u7EC4\u4EF6\u4E8B\u4EF6 - Don't touch me\n // Comp Prop Events Inner End\n }\n\n }\n\n namespace dataset {\n\n const state: {\n // Comp State Inner Begin\n // Comp State \u7EC4\u4EF6\u53D8\u91CF - Don't touch me\n // Comp State Inner End\n }\n\n }\n\n namespace handler {\n // Comp Handler Inner Begin\n // Comp Handler \u7EC4\u4EF6\u65B9\u6CD5 - Don't touch me\n // Comp Handler Inner End\n }\n\n}\n// $comp End\n\n// Global Formula Begin\n\ndeclare function ABS(num: number): number;\ndeclare function Min(...args: number[]): number;\ndeclare function Max(...args: number[]): number;\ndeclare function Average(...args: number[]): number;\ndeclare function Floor(num: number): number;\ndeclare function Ceiling(num: number): number;\ndeclare function Round(num: number): number;\ndeclare function Sum(...args: number[]): number;\ndeclare function Rand(num: number): number;\n\ndeclare function If(condition: boolean, val1: any, val2: any): any;\ndeclare function IsEmpty(text: string | string[]): boolean;\ndeclare function NotNull(val: any): boolean;\ndeclare function And(...args: boolean[]): boolean;\ndeclare function Or(...args: boolean[]): boolean;\n\ndeclare function Len(text: string): number;\ndeclare function Contains(text1: string, text2: string): boolean;\ndeclare function Split(text1: string, text2: string): string[];\ndeclare function Trim(text: string): string;\ndeclare function Upper(text: string): string;\ndeclare function Lower(text: string): string;\ndeclare function Concat(...text: string[]): string;\n\ndeclare function Now(): number;\ndeclare function Timestamp(arg: number | string | Date): number;\ndeclare function Second(arg: number | string | Date): number;\ndeclare function Minute(arg: number | string | Date): number;\ndeclare function Hour(arg: number | string | Date): number;\ndeclare function Day(arg: number | string | Date): number;\ndeclare function DayOfWeek(arg: number | string | Date): number;\ndeclare function Month(arg: number | string | Date): number;\ndeclare function Year(arg: number | string | Date): number;\ndeclare function GetDate(year: number, month: number, day: number): number;\ndeclare function DateTimeValue(arg: string, val: string): number;\ndeclare function Age(arg: number | string | Date, val: number | string | Date): number;\ndeclare function AgeOfNow(arg: number | string | Date): number;\ndeclare function DateAdd(arg: number | string | Date, day: number): number;\ndeclare function MonthAdd(arg: number | string | Date, month: number): number;\ndeclare function YearAdd(arg: number | string | Date, year: number): number;\ndeclare function DateDiff(startDay: number | string | Date, endDay: number | string | Date): number;\ndeclare function HourDiff(startDay: number | string | Date, endDay: number | string | Date): number;\ndeclare function MinuteDiff(startDay: number | string | Date, endDay: number | string | Date): number;\ndeclare function SecondDiff(startDay: number | string | Date, endDay: number | string | Date): number;\ndeclare function MonthDiff(startDay: number | string | Date, endDay: number | string | Date): number;\ndeclare function YearDiff(startDay: number | string | Date, endDay: number | string | Date): number;\ndeclare function DateText(createdTime: number | string | Date, text: string): string;\ndeclare function IsToday(date: number | string | Date): boolean;\n\n\n// Global Formula End\n";
|
|
2
2
|
//# sourceMappingURL=auto-generated.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auto-generated.d.ts","sourceRoot":"","sources":["../../../src/utils/dts/auto-generated.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO
|
|
1
|
+
{"version":3,"file":"auto-generated.d.ts","sourceRoot":"","sources":["../../../src/utils/dts/auto-generated.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,04WA8WnB,CAAA"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.wedaDTS = void 0;
|
|
4
|
-
exports.wedaDTS = `
|
|
5
|
-
declare class UserWidget {
|
|
4
|
+
exports.wedaDTS = `declare class UserWidget {
|
|
6
5
|
// FIXME: 暂时不对外暴露
|
|
7
6
|
// 内置命名空间
|
|
8
7
|
// get sys(): {
|
|
@@ -46,103 +45,90 @@ declare class UserWidget {
|
|
|
46
45
|
|
|
47
46
|
declare namespace $app {
|
|
48
47
|
namespace dataset {
|
|
48
|
+
const state: {
|
|
49
|
+
// Global State Inner Begin
|
|
50
|
+
// Global State 全局变量 - Don't touch me
|
|
51
|
+
// Global State Inner End
|
|
52
|
+
};
|
|
53
|
+
}
|
|
49
54
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
+
namespace common {
|
|
56
|
+
// Global Common Inner Begin
|
|
57
|
+
// Global Common 全局方法 - Don't touch me
|
|
58
|
+
// Global Common Inner End
|
|
59
|
+
}
|
|
55
60
|
|
|
56
|
-
|
|
61
|
+
function setState(data: Object): void;
|
|
57
62
|
|
|
58
|
-
|
|
59
|
-
function ABS(num: number): number;
|
|
60
|
-
function Min(...args: number[]): number;
|
|
61
|
-
function Max(...args: number[]): number;
|
|
62
|
-
function Average(...args: number[]): number;
|
|
63
|
-
function Floor(num: number): number;
|
|
64
|
-
function Ceiling(num: number): number;
|
|
65
|
-
function Round(num: number): number;
|
|
66
|
-
function Sum(...args: number[]): number;
|
|
67
|
-
function Rand(num: number): number;
|
|
63
|
+
}
|
|
68
64
|
|
|
69
|
-
|
|
70
|
-
function IsEmpty(text: string | string[]): boolean;
|
|
71
|
-
function NotNull(val: any): boolean;
|
|
72
|
-
function And(...args: boolean[]): boolean;
|
|
73
|
-
function Or(...args: boolean[]): boolean;
|
|
65
|
+
declare const app = $app;
|
|
74
66
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
function Split(text1: string, text2: string): string[];
|
|
78
|
-
function Trim(text: string): string;
|
|
79
|
-
function Upper(text: string): string;
|
|
80
|
-
function Lower(text: string): string;
|
|
81
|
-
function Concat(...text: string[]): string;
|
|
82
|
-
|
|
83
|
-
function Now(): number;
|
|
84
|
-
function Timestamp(arg: number | string | Date): number;
|
|
85
|
-
function Second(arg: number | string | Date): number;
|
|
86
|
-
function Minute(arg: number | string | Date): number;
|
|
87
|
-
function Hour(arg: number | string | Date): number;
|
|
88
|
-
function Day(arg: number | string | Date): number;
|
|
89
|
-
function DayOfWeek(arg: number | string | Date): number;
|
|
90
|
-
function Month(arg: number | string | Date): number;
|
|
91
|
-
function Year(arg: number | string | Date): number;
|
|
92
|
-
function GetDate(year: number, month: number, day: number): number;
|
|
93
|
-
function DateTimeValue(arg: string, val: string): number;
|
|
94
|
-
function Age(arg: number | string | Date, val: number | string | Date): number;
|
|
95
|
-
function AgeOfNow(arg: number | string | Date): number;
|
|
96
|
-
function DateAdd(arg: number | string | Date, day: number): number;
|
|
97
|
-
function MonthAdd(arg: number | string | Date, month: number): number;
|
|
98
|
-
function YearAdd(arg: number | string | Date, year: number): number;
|
|
99
|
-
function DateDiff(startDay: number | string | Date, endDay: number | string | Date): number;
|
|
100
|
-
function HourDiff(startDay: number | string | Date, endDay: number | string | Date): number;
|
|
101
|
-
function MinuteDiff(startDay: number | string | Date, endDay: number | string | Date): number;
|
|
102
|
-
function SecondDiff(startDay: number | string | Date, endDay: number | string | Date): number;
|
|
103
|
-
function MonthDiff(startDay: number | string | Date, endDay: number | string | Date): number;
|
|
104
|
-
function YearDiff(startDay: number | string | Date, endDay: number | string | Date): number;
|
|
105
|
-
function DateText(createdTime: number | string | Date, text: string): string;
|
|
106
|
-
function IsToday(date: number | string | Date): boolean;
|
|
107
|
-
|
|
108
|
-
}
|
|
67
|
+
declare namespace $w {
|
|
68
|
+
const app = $app;
|
|
109
69
|
|
|
110
|
-
|
|
111
|
-
// Global Common Inner Begin
|
|
112
|
-
// Global Common 全局方法 - Don't touch me
|
|
113
|
-
// Global Common Inner End
|
|
114
|
-
}
|
|
70
|
+
const page = $page;
|
|
115
71
|
|
|
116
72
|
namespace auth {
|
|
117
|
-
|
|
118
|
-
userId?: string
|
|
119
|
-
phone?: string
|
|
120
|
-
type?: number
|
|
73
|
+
interface CurrentUserInfo {
|
|
74
|
+
userId?: string;
|
|
75
|
+
phone?: string;
|
|
76
|
+
type?: number;
|
|
121
77
|
relatedRoles?: {
|
|
122
|
-
id?: string
|
|
123
|
-
envId?: string
|
|
124
|
-
name?: string
|
|
125
|
-
roleIdentity?: string
|
|
126
|
-
}[]
|
|
127
|
-
openId?: string
|
|
128
|
-
name?: string
|
|
129
|
-
nickName?: string
|
|
130
|
-
email?: string
|
|
78
|
+
id?: string;
|
|
79
|
+
envId?: string;
|
|
80
|
+
name?: string;
|
|
81
|
+
roleIdentity?: string;
|
|
82
|
+
}[];
|
|
83
|
+
openId?: string;
|
|
84
|
+
name?: string;
|
|
85
|
+
nickName?: string;
|
|
86
|
+
email?: string;
|
|
131
87
|
mainOrg?: {
|
|
132
|
-
id?: string
|
|
133
|
-
name?: string
|
|
134
|
-
}
|
|
88
|
+
id?: string;
|
|
89
|
+
name?: string;
|
|
90
|
+
};
|
|
135
91
|
orgs?: {
|
|
136
|
-
id?: string
|
|
137
|
-
name?: string
|
|
138
|
-
}[]
|
|
92
|
+
id?: string;
|
|
93
|
+
name?: string;
|
|
94
|
+
}[];
|
|
139
95
|
}
|
|
96
|
+
function getUserInfo(): CurrentUserInfo;
|
|
97
|
+
const currentUser: CurrentUserInfo;
|
|
140
98
|
|
|
141
99
|
}
|
|
142
100
|
|
|
143
|
-
|
|
101
|
+
namespace cloud {
|
|
102
|
+
interface ICallDataSourceParams {
|
|
103
|
+
dataSourceName: string;
|
|
104
|
+
methodName: string;
|
|
105
|
+
params: Object;
|
|
106
|
+
}
|
|
107
|
+
interface ICallFunctionParams {
|
|
108
|
+
name: string;
|
|
109
|
+
data?: any;
|
|
110
|
+
}
|
|
111
|
+
interface IParseOptions {
|
|
112
|
+
unwrapResult?: boolean;
|
|
113
|
+
parseBusinessInfo?: boolean;
|
|
114
|
+
}
|
|
115
|
+
interface ICallWorkflowParams {
|
|
116
|
+
action: string;
|
|
117
|
+
data?: Record<string, any>;
|
|
118
|
+
capitalizeDataKey?: boolean;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function callDataSource(params: ICallDataSourceParams): any;
|
|
122
|
+
function getTempFileURL(params: string | string[]): Promise<string | string[]>;
|
|
123
|
+
function callWorkflow(action: ICallWorkflowParams): Promise<any>;
|
|
124
|
+
function callFunction(params: ICallFunctionParams, parseOptions?: IParseOptions): Promise<any>;
|
|
125
|
+
function getCloudInstance(): Promise<CloudInstance>;
|
|
126
|
+
|
|
127
|
+
}
|
|
144
128
|
|
|
145
|
-
|
|
129
|
+
// $w.utils
|
|
130
|
+
namespace utils {
|
|
131
|
+
interface navigatorOptions {
|
|
146
132
|
packageName: string;
|
|
147
133
|
pageId: string;
|
|
148
134
|
data?: Record<string, any>;
|
|
@@ -157,29 +143,20 @@ interface navigateBackOptions {
|
|
|
157
143
|
delta: number;
|
|
158
144
|
}
|
|
159
145
|
|
|
160
|
-
// 设置状态
|
|
161
|
-
function setState(userSetState: Record<string, any>): void
|
|
162
|
-
|
|
163
|
-
// 特制路由
|
|
164
|
-
function navigateTo(options: navigatorOptions)
|
|
165
|
-
function redirectTo(options: navigatorOptions)
|
|
166
|
-
function reLaunch(options: navigatorOptions)
|
|
167
|
-
function navigateBack(options: navigateBackOptions)
|
|
168
|
-
|
|
169
146
|
// 显示提示
|
|
170
147
|
function showToast(options);
|
|
171
148
|
|
|
172
|
-
// 显示模态提示
|
|
173
|
-
function showModal(options);
|
|
174
|
-
|
|
175
149
|
// 显示 loading 提示
|
|
176
150
|
function showLoading(options);
|
|
177
151
|
|
|
178
152
|
// 隐藏 loading 提示
|
|
179
153
|
function hideLoading(options);
|
|
180
154
|
|
|
181
|
-
//
|
|
182
|
-
function
|
|
155
|
+
// 显示模态提示
|
|
156
|
+
function showModal(options);
|
|
157
|
+
|
|
158
|
+
// 拨打电话
|
|
159
|
+
function callPhone(options);
|
|
183
160
|
|
|
184
161
|
// sacnCode
|
|
185
162
|
function scanCode(options: {
|
|
@@ -191,12 +168,19 @@ function scanCode(options: {
|
|
|
191
168
|
complete?: () => void;
|
|
192
169
|
}): Promise<ScanCodeResult> | ScanCodeResult;
|
|
193
170
|
|
|
171
|
+
// 特制路由
|
|
172
|
+
function navigateTo(options: navigatorOptions);
|
|
173
|
+
|
|
174
|
+
function redirectTo(options: navigatorOptions);
|
|
194
175
|
|
|
195
|
-
|
|
176
|
+
function reLaunch(options: navigatorOptions);
|
|
196
177
|
|
|
197
|
-
|
|
178
|
+
function relaunchHome();
|
|
179
|
+
|
|
180
|
+
function navigateBack(options: navigateBackOptions);
|
|
181
|
+
|
|
182
|
+
}
|
|
198
183
|
|
|
199
|
-
declare namespace $w {
|
|
200
184
|
function ABS(num: number): number;
|
|
201
185
|
function Min(...args: number[]): number;
|
|
202
186
|
function Max(...args: number[]): number;
|
|
@@ -267,33 +251,27 @@ declare const forItems = $for
|
|
|
267
251
|
|
|
268
252
|
// $page Begin
|
|
269
253
|
declare namespace $page {
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
// Page Handler Inner End
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
// 设置状态
|
|
295
|
-
function setState(userSetState: Record<string, any>): void
|
|
254
|
+
const id: string;
|
|
255
|
+
|
|
256
|
+
namespace dataset {
|
|
257
|
+
const state: {
|
|
258
|
+
// Page State Inner Begin
|
|
259
|
+
// Page State 页面变量 - Don't touch me
|
|
260
|
+
// Page State Inner End
|
|
261
|
+
};
|
|
262
|
+
const params: {
|
|
263
|
+
// Page Param Inner Begin
|
|
264
|
+
// Page Param 页面参数 - Don't touch me
|
|
265
|
+
// Page Param Inner End
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
namespace handler {
|
|
269
|
+
// Page Handler Inner Begin
|
|
270
|
+
// Page Handler 页面方法 - Don't touch me
|
|
271
|
+
// Page Handler Inner End
|
|
272
|
+
}
|
|
296
273
|
|
|
274
|
+
function setState(userSetState: Record<string, any>): void;
|
|
297
275
|
|
|
298
276
|
}
|
|
299
277
|
// $page End
|
package/lib/utils/dts/build.js
CHANGED
|
@@ -56,13 +56,24 @@ function genWeDaAPPDTS() {
|
|
|
56
56
|
* 获取所有的 DTS
|
|
57
57
|
*/
|
|
58
58
|
const wedaFrameworkDTS = yield fs_extra_1.default.readFile(path_1.default.resolve(__dirname, 'framework', 'weda-framework.d.ts'), 'utf8'); // 低码框架
|
|
59
|
-
const
|
|
60
|
-
const
|
|
59
|
+
const wedaAppDTS = yield fs_extra_1.default.readFile(path_1.default.resolve(__dirname, 'framework', 'weda-app.d.ts'), 'utf-8'); // app对象
|
|
60
|
+
const wedaPageDTS = yield fs_extra_1.default.readFile(path_1.default.resolve(__dirname, 'framework', 'weda-page.d.ts'), 'utf-8'); // page对象
|
|
61
|
+
const wedaAuthDTS = yield fs_extra_1.default.readFile(path_1.default.resolve(__dirname, 'framework', 'weda-auth.d.ts'), 'utf8'); // auth对象
|
|
62
|
+
const wedaCloudDTS = yield fs_extra_1.default.readFile(path_1.default.resolve(__dirname, 'framework', 'weda-cloud.d.ts'), 'utf-8'); // cloud对象
|
|
63
|
+
const wedaUtilsDTS = yield fs_extra_1.default.readFile(path_1.default.resolve(__dirname, 'framework', 'weda-utils.d.ts'), 'utf-8'); // page对象
|
|
61
64
|
const formulaDTS = yield buildFormulaDTS(); // 函数公式
|
|
62
65
|
/**
|
|
63
66
|
* 聚合 DTS
|
|
64
67
|
*/
|
|
65
|
-
const wedaDTS = groupDTSs({
|
|
68
|
+
const wedaDTS = groupDTSs({
|
|
69
|
+
wedaFrameworkDTS,
|
|
70
|
+
wedaAppDTS,
|
|
71
|
+
wedaPageDTS,
|
|
72
|
+
wedaAuthDTS,
|
|
73
|
+
wedaCloudDTS,
|
|
74
|
+
wedaUtilsDTS,
|
|
75
|
+
formulaDTS,
|
|
76
|
+
});
|
|
66
77
|
/**
|
|
67
78
|
* 将聚合结果保存在 auto-generated.ts
|
|
68
79
|
*/
|
|
@@ -73,21 +84,22 @@ function genWeDaAPPDTS() {
|
|
|
73
84
|
/**
|
|
74
85
|
* 聚合所有的 DTS(不包括动态生成的)
|
|
75
86
|
*/
|
|
76
|
-
function groupDTSs({ wedaFrameworkDTS = '',
|
|
87
|
+
function groupDTSs({ wedaFrameworkDTS = '', wedaAppDTS = '', wedaPageDTS = '', wedaAuthDTS = '', wedaCloudDTS = '', wedaUtilsDTS = '', formulaDTS = '', }) {
|
|
77
88
|
let resultDts = wedaFrameworkDTS;
|
|
78
|
-
//
|
|
79
|
-
resultDts = resultDts.
|
|
89
|
+
// $app
|
|
90
|
+
resultDts = resultDts.replaceAll("// $app - Don't touch me", wedaAppDTS);
|
|
91
|
+
// $page
|
|
92
|
+
resultDts = resultDts.replaceAll("// $page - Don't touch me", wedaPageDTS);
|
|
93
|
+
// $w.auth
|
|
94
|
+
resultDts = resultDts.replaceAll("// $w.auth - Don't touch me", wedaAuthDTS.replace(/declare/g, ''));
|
|
95
|
+
// $w.cloud
|
|
96
|
+
resultDts = resultDts.replaceAll("// $w.cloud - Don't touch me", wedaCloudDTS.replace(/declare/g, ''));
|
|
97
|
+
// $w.utils
|
|
98
|
+
resultDts = resultDts.replaceAll("// $w.utils - Don't touch me", wedaUtilsDTS.replace(/declare/g, ''));
|
|
99
|
+
// 函数公式:$w.xxx
|
|
100
|
+
resultDts = resultDts.replaceAll("// Formula 函数公式 - Don't touch me", formulaDTS.replace(/export/g, ''));
|
|
80
101
|
// 函数公式:全局变量提示
|
|
81
102
|
resultDts = resultDts.replace("// Global Formula 全局函数公式- Don't touch me", formulaDTS.replace(/export/g, 'declare'));
|
|
82
|
-
// 函数公式:$w.xxx
|
|
83
|
-
resultDts = resultDts.replace("// $w global APIs - Don't touch me", formulaDTS.replace(/export/g, ''));
|
|
84
|
-
// 增加 API
|
|
85
|
-
const appAPIDTS = wedaAPIDTS.replace(/[\s\S]*\/\/ ============ App API Begin ============ \/\/([\s\S]*?)\/\/ ============ App API End ============ \/\/[\s\S]*/, '$1');
|
|
86
|
-
resultDts = resultDts.replace("// App API - Don't touch me", appAPIDTS);
|
|
87
|
-
const pageAPIDTS = wedaAPIDTS.replace(/[\s\S]*\/\/ ============ Page API Begin ============ \/\/([\s\S]*?)\/\/ ============ Page API End ============ \/\/[\s\S]*/, '$1');
|
|
88
|
-
resultDts = resultDts.replace("// Page API - Don't touch me", pageAPIDTS);
|
|
89
|
-
// 增加 Auth 信息
|
|
90
|
-
resultDts = resultDts.replace("// Auth 认证 - Don't touch me", wedaAuthDTS);
|
|
91
103
|
return resultDts;
|
|
92
104
|
}
|
|
93
105
|
function main() {
|
|
@@ -97,8 +109,11 @@ function main() {
|
|
|
97
109
|
if (watchArgv === '--watch') {
|
|
98
110
|
console.log('Start watching mode');
|
|
99
111
|
(0, node_watch_1.default)(path_1.default.resolve(__dirname, 'framework', 'weda-framework.d.ts'), genWeDaAPPDTS);
|
|
100
|
-
(0, node_watch_1.default)(path_1.default.resolve(__dirname, 'framework', 'weda-
|
|
112
|
+
(0, node_watch_1.default)(path_1.default.resolve(__dirname, 'framework', 'weda-app.d.ts'), genWeDaAPPDTS);
|
|
113
|
+
(0, node_watch_1.default)(path_1.default.resolve(__dirname, 'framework', 'weda-page.d.ts'), genWeDaAPPDTS);
|
|
101
114
|
(0, node_watch_1.default)(path_1.default.resolve(__dirname, 'framework', 'weda-auth.d.ts'), genWeDaAPPDTS);
|
|
115
|
+
(0, node_watch_1.default)(path_1.default.resolve(__dirname, 'framework', 'weda-cloud.d.ts'), genWeDaAPPDTS);
|
|
116
|
+
(0, node_watch_1.default)(path_1.default.resolve(__dirname, 'framework', 'weda-utils.d.ts'), genWeDaAPPDTS);
|
|
102
117
|
}
|
|
103
118
|
});
|
|
104
119
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudbase/cals",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.13",
|
|
4
4
|
"description": "Common application specifications",
|
|
5
5
|
"main": "lib/utils/index.js",
|
|
6
6
|
"source": "src/utils/index.ts",
|
|
@@ -53,4 +53,4 @@
|
|
|
53
53
|
"typescript": "^4.7.4",
|
|
54
54
|
"typescript-json-schema": "^0.53.0"
|
|
55
55
|
}
|
|
56
|
-
}
|
|
56
|
+
}
|