iglooform 3.4.1 → 3.5.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.
Files changed (118) hide show
  1. package/.dumi/tmp/core/defineApp.ts +1 -1
  2. package/.dumi/tmp/core/helmet.ts +1 -1
  3. package/.dumi/tmp/core/history.ts +1 -1
  4. package/.dumi/tmp/core/historyIntelli.ts +1 -1
  5. package/.dumi/tmp/core/plugin.ts +2 -2
  6. package/.dumi/tmp/core/polyfill.ts +197 -197
  7. package/.dumi/tmp/core/route.tsx +33 -33
  8. package/.dumi/tmp/dumi/exports.ts +1 -1
  9. package/.dumi/tmp/dumi/locales/runtime.tsx +2 -2
  10. package/.dumi/tmp/dumi/meta/index.ts +33 -33
  11. package/.dumi/tmp/dumi/meta/runtime.ts +1 -1
  12. package/.dumi/tmp/dumi/theme/ContextWrapper.tsx +2 -2
  13. package/.dumi/tmp/dumi/theme/builtins/API.ts +1 -1
  14. package/.dumi/tmp/dumi/theme/builtins/Badge.ts +1 -1
  15. package/.dumi/tmp/dumi/theme/builtins/Container.ts +1 -1
  16. package/.dumi/tmp/dumi/theme/builtins/Previewer.ts +1 -1
  17. package/.dumi/tmp/dumi/theme/builtins/SourceCode.ts +1 -1
  18. package/.dumi/tmp/dumi/theme/builtins/Table.ts +1 -1
  19. package/.dumi/tmp/dumi/theme/builtins/Tree.ts +1 -1
  20. package/.dumi/tmp/dumi/theme/layouts/DocLayout.ts +1 -1
  21. package/.dumi/tmp/dumi/theme/loading.tsx +1 -1
  22. package/.dumi/tmp/dumi/theme/slots/ColorSwitch.ts +1 -1
  23. package/.dumi/tmp/dumi/theme/slots/Content.ts +1 -1
  24. package/.dumi/tmp/dumi/theme/slots/ContentFooter.ts +1 -1
  25. package/.dumi/tmp/dumi/theme/slots/ContentTabs.ts +1 -1
  26. package/.dumi/tmp/dumi/theme/slots/Features.ts +1 -1
  27. package/.dumi/tmp/dumi/theme/slots/Footer.ts +1 -1
  28. package/.dumi/tmp/dumi/theme/slots/Header.ts +1 -1
  29. package/.dumi/tmp/dumi/theme/slots/HeaderExtra.ts +1 -1
  30. package/.dumi/tmp/dumi/theme/slots/Hero.ts +1 -1
  31. package/.dumi/tmp/dumi/theme/slots/HeroTitle.ts +1 -1
  32. package/.dumi/tmp/dumi/theme/slots/LangSwitch.ts +1 -1
  33. package/.dumi/tmp/dumi/theme/slots/Logo.ts +1 -1
  34. package/.dumi/tmp/dumi/theme/slots/Navbar.ts +1 -1
  35. package/.dumi/tmp/dumi/theme/slots/NavbarExtra.ts +1 -1
  36. package/.dumi/tmp/dumi/theme/slots/NotFound.ts +1 -1
  37. package/.dumi/tmp/dumi/theme/slots/PreviewerActions.ts +1 -1
  38. package/.dumi/tmp/dumi/theme/slots/PreviewerActionsExtra.ts +1 -1
  39. package/.dumi/tmp/dumi/theme/slots/RtlSwitch.ts +1 -1
  40. package/.dumi/tmp/dumi/theme/slots/SearchBar.ts +2 -2
  41. package/.dumi/tmp/dumi/theme/slots/SearchResult.ts +1 -1
  42. package/.dumi/tmp/dumi/theme/slots/Sidebar.ts +1 -1
  43. package/.dumi/tmp/dumi/theme/slots/SocialIcon.ts +1 -1
  44. package/.dumi/tmp/dumi/theme/slots/Toc.ts +1 -1
  45. package/.dumi/tmp/exports.ts +5 -5
  46. package/.dumi/tmp/testBrowser.tsx +3 -3
  47. package/.dumi/tmp/umi.ts +4 -4
  48. package/es/currency-context/index.d.ts +1 -1
  49. package/es/index.d.ts +1 -0
  50. package/es/index.js +1 -0
  51. package/es/upload-photo/index.d.ts +28 -0
  52. package/es/utils/form-utils.d.ts +79 -0
  53. package/lib/currency-context/index.d.ts +1 -1
  54. package/lib/index.d.ts +1 -0
  55. package/lib/index.js +7 -0
  56. package/lib/upload-photo/index.d.ts +28 -0
  57. package/lib/utils/form-utils.d.ts +79 -0
  58. package/package.json +1 -1
  59. package/.dumi/tmp/core/EmptyRoute.d.ts +0 -1
  60. package/.dumi/tmp/core/defineApp.d.ts +0 -22
  61. package/.dumi/tmp/core/exportStaticRuntimePlugin.d.ts +0 -1
  62. package/.dumi/tmp/core/helmet.d.ts +0 -3
  63. package/.dumi/tmp/core/helmetContext.d.ts +0 -1
  64. package/.dumi/tmp/core/history.d.ts +0 -4
  65. package/.dumi/tmp/core/historyIntelli.d.ts +0 -50
  66. package/.dumi/tmp/core/plugin.d.ts +0 -25
  67. package/.dumi/tmp/core/pluginConfig.d.ts +0 -315
  68. package/.dumi/tmp/core/polyfill.d.ts +0 -198
  69. package/.dumi/tmp/core/route.d.ts +0 -230
  70. package/.dumi/tmp/core/terminal.d.ts +0 -14
  71. package/.dumi/tmp/dumi/exports.d.ts +0 -2
  72. package/.dumi/tmp/dumi/locales/config.d.ts +0 -90
  73. package/.dumi/tmp/dumi/locales/runtime.d.ts +0 -2
  74. package/.dumi/tmp/dumi/meta/atoms.d.ts +0 -1
  75. package/.dumi/tmp/dumi/meta/index.d.ts +0 -203
  76. package/.dumi/tmp/dumi/meta/runtime.d.ts +0 -3
  77. package/.dumi/tmp/dumi/meta/tabs.d.ts +0 -1
  78. package/.dumi/tmp/dumi/theme/ContextWrapper.d.ts +0 -1
  79. package/.dumi/tmp/dumi/theme/builtins/API.d.ts +0 -1
  80. package/.dumi/tmp/dumi/theme/builtins/Badge.d.ts +0 -1
  81. package/.dumi/tmp/dumi/theme/builtins/Container.d.ts +0 -1
  82. package/.dumi/tmp/dumi/theme/builtins/Previewer.d.ts +0 -1
  83. package/.dumi/tmp/dumi/theme/builtins/SourceCode.d.ts +0 -1
  84. package/.dumi/tmp/dumi/theme/builtins/Table.d.ts +0 -1
  85. package/.dumi/tmp/dumi/theme/builtins/Tree.d.ts +0 -1
  86. package/.dumi/tmp/dumi/theme/layouts/DocLayout.d.ts +0 -1
  87. package/.dumi/tmp/dumi/theme/loading.d.ts +0 -4
  88. package/.dumi/tmp/dumi/theme/slots/ColorSwitch.d.ts +0 -1
  89. package/.dumi/tmp/dumi/theme/slots/Content.d.ts +0 -1
  90. package/.dumi/tmp/dumi/theme/slots/ContentFooter.d.ts +0 -1
  91. package/.dumi/tmp/dumi/theme/slots/ContentTabs.d.ts +0 -1
  92. package/.dumi/tmp/dumi/theme/slots/Features.d.ts +0 -1
  93. package/.dumi/tmp/dumi/theme/slots/Footer.d.ts +0 -1
  94. package/.dumi/tmp/dumi/theme/slots/Header.d.ts +0 -1
  95. package/.dumi/tmp/dumi/theme/slots/HeaderExtra.d.ts +0 -1
  96. package/.dumi/tmp/dumi/theme/slots/Hero.d.ts +0 -1
  97. package/.dumi/tmp/dumi/theme/slots/HeroTitle.d.ts +0 -1
  98. package/.dumi/tmp/dumi/theme/slots/LangSwitch.d.ts +0 -1
  99. package/.dumi/tmp/dumi/theme/slots/Logo.d.ts +0 -1
  100. package/.dumi/tmp/dumi/theme/slots/Navbar.d.ts +0 -1
  101. package/.dumi/tmp/dumi/theme/slots/NavbarExtra.d.ts +0 -1
  102. package/.dumi/tmp/dumi/theme/slots/NotFound.d.ts +0 -1
  103. package/.dumi/tmp/dumi/theme/slots/PreviewerActions.d.ts +0 -1
  104. package/.dumi/tmp/dumi/theme/slots/PreviewerActionsExtra.d.ts +0 -1
  105. package/.dumi/tmp/dumi/theme/slots/RtlSwitch.d.ts +0 -1
  106. package/.dumi/tmp/dumi/theme/slots/SearchBar.d.ts +0 -2
  107. package/.dumi/tmp/dumi/theme/slots/SearchResult.d.ts +0 -1
  108. package/.dumi/tmp/dumi/theme/slots/Sidebar.d.ts +0 -1
  109. package/.dumi/tmp/dumi/theme/slots/SocialIcon.d.ts +0 -1
  110. package/.dumi/tmp/dumi/theme/slots/Toc.d.ts +0 -1
  111. package/.dumi/tmp/exports.d.ts +0 -11
  112. package/.dumi/tmp/plugin-antd/runtime.d.ts +0 -1
  113. package/.dumi/tmp/plugin-html2sketch/index.d.ts +0 -1
  114. package/.dumi/tmp/testBrowser.d.ts +0 -10
  115. package/.dumi/tmp/umi.d.ts +0 -4
  116. package/es/media/preview.d.ts +0 -12
  117. package/lib/media/preview.d.ts +0 -12
  118. package/yarn-error.log +0 -16168
@@ -0,0 +1,28 @@
1
+ import { FC, IglooComponentProps } from '../types';
2
+ import './style';
3
+ export interface Props extends IglooComponentProps {
4
+ handleUpload?(file: File): PromiseLike<string>;
5
+ value?: (string | {
6
+ name: string;
7
+ status: 'failed';
8
+ errorMsg: string;
9
+ })[];
10
+ onChange?: (value: any) => void;
11
+ limit?: number;
12
+ limitErrorMessage?: Function | string;
13
+ descriptions?: any;
14
+ buttonText?: any;
15
+ samples?: Sample[];
16
+ className?: any;
17
+ id?: string;
18
+ bizKey?: string;
19
+ capture?: boolean;
20
+ disabled?: boolean;
21
+ }
22
+ export type Sample = {
23
+ src: string;
24
+ label?: string;
25
+ type?: 'good' | 'bad';
26
+ };
27
+ declare const UploadPhoto: FC<Props>;
28
+ export default UploadPhoto;
@@ -0,0 +1,79 @@
1
+ import React from 'react';
2
+ import { FormInstance } from 'antd/es/form';
3
+ import { FormItemConfig, FormItemExtraConfig, FormItemName, FormItemCopyValue, FormItemSelectValue, FormItemAssert, Rule } from '../types';
4
+ import { NamePath } from 'antd/es/form/interface';
5
+ export declare const calcNamePath: (parentName: FormItemName | undefined, name: FormItemName | undefined) => any[];
6
+ export declare const testAssert: (form: FormInstance, assert: FormItemAssert) => boolean;
7
+ export declare const calcFormItemProps: (config: FormItemConfig, extraProps: FormItemExtraConfig, form?: FormInstance, parentName?: FormItemName, validationCodeExtraParams?: Record<string, any>) => {
8
+ colProps: {
9
+ span: number;
10
+ xs: number;
11
+ sm: number;
12
+ md: number;
13
+ halfRow: boolean | undefined;
14
+ };
15
+ formItemProps: {
16
+ name: any[];
17
+ className: string | undefined;
18
+ initialValue: any;
19
+ copiedValue: {
20
+ copied: boolean;
21
+ value?: undefined;
22
+ disabled?: undefined;
23
+ } | {
24
+ copied: boolean;
25
+ value: any;
26
+ disabled: boolean | undefined;
27
+ };
28
+ selectedValue: {
29
+ selected: boolean;
30
+ value?: undefined;
31
+ disabled?: undefined;
32
+ } | {
33
+ selected: boolean;
34
+ value: any;
35
+ disabled: boolean | undefined;
36
+ };
37
+ normalize: ((value: any, prevValue: any, allValues: import("rc-field-form/lib/interface").Store) => any) | undefined;
38
+ rules: Rule[];
39
+ validateTrigger: any[];
40
+ label: import("react/jsx-runtime").JSX.Element | null;
41
+ getValueFromEvent: ((...args: import("rc-field-form/lib/interface").EventArgs) => any) | undefined;
42
+ getValueProps: ((value: any) => Record<string, unknown>) | undefined;
43
+ extra: false | "" | 0 | import("react/jsx-runtime").JSX.Element | null | undefined;
44
+ help: React.ReactNode;
45
+ valuePropName: string | undefined;
46
+ messageVariables: {
47
+ label: string;
48
+ };
49
+ dependencies: any[] | undefined;
50
+ };
51
+ elementProps: {
52
+ [key: string]: any;
53
+ };
54
+ display: any;
55
+ previewFormater: ((value: any, form?: FormInstance<any> | undefined) => any) | undefined;
56
+ };
57
+ export declare const calcDisabled: (disabled?: boolean | FormItemAssert | FormItemAssert[], form?: FormInstance, disabledCode?: string, name?: FormItemName, parentName?: FormItemName) => any;
58
+ export declare const calcCopyValue: (copyValue?: FormItemCopyValue, form?: FormInstance) => {
59
+ copied: boolean;
60
+ value?: undefined;
61
+ disabled?: undefined;
62
+ } | {
63
+ copied: boolean;
64
+ value: any;
65
+ disabled: boolean | undefined;
66
+ };
67
+ export declare const calcSelectValue: (selectValue?: FormItemSelectValue[], form?: FormInstance) => {
68
+ selected: boolean;
69
+ value?: undefined;
70
+ disabled?: undefined;
71
+ } | {
72
+ selected: boolean;
73
+ value: any;
74
+ disabled: boolean | undefined;
75
+ };
76
+ export declare const calcShouldRender: (name: NamePath, parentName: NamePath, dependencies?: NamePath[], asserts?: FormItemAssert[], shouldRender?: ((form?: FormInstance) => boolean) | undefined, shouldRenderCode?: string, form?: FormInstance) => any;
77
+ export declare const automaticCalculate: (name: NamePath, parentName: NamePath, automaticCalcCode?: string, form?: FormInstance) => void;
78
+ export declare const getRuleValidation: (url: string, rule: string | string[], values?: any, lang?: string) => Promise<any>;
79
+ export declare const calcAddableSectionAssertField: (name: any[], field: FormItemAssert['field'], index: number, elements: FormItemConfig[] | React.ReactElement[]) => any;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- interface CurrencyMethod {
2
+ export interface CurrencyMethod {
3
3
  exchange: (value: any) => any;
4
4
  exchangeBack: (value: any) => any;
5
5
  currentCurrency: string;
package/lib/index.d.ts CHANGED
@@ -20,6 +20,7 @@ export { default as Table } from './table';
20
20
  export { default as StatusBox } from './status-box';
21
21
  export { CardPage, Card, CardGroup, CardItem } from './card-detail';
22
22
  export { default as AdminMedia } from './media';
23
+ export { default as MediaViewer } from './media/preview';
23
24
  export { default as Documents } from './documents';
24
25
  export { default as Filter } from './filter';
25
26
  export { default as CurrencyContext } from './currency-context';
package/lib/index.js CHANGED
@@ -280,6 +280,12 @@ Object.defineProperty(exports, "MediaPreview", {
280
280
  return _media2.default;
281
281
  }
282
282
  });
283
+ Object.defineProperty(exports, "MediaViewer", {
284
+ enumerable: true,
285
+ get: function get() {
286
+ return _preview.default;
287
+ }
288
+ });
283
289
  Object.defineProperty(exports, "MobileInsurerDetail", {
284
290
  enumerable: true,
285
291
  get: function get() {
@@ -470,6 +476,7 @@ var _table = _interopRequireDefault(require("./table"));
470
476
  var _statusBox = _interopRequireDefault(require("./status-box"));
471
477
  var _cardDetail = require("./card-detail");
472
478
  var _media = _interopRequireDefault(require("./media"));
479
+ var _preview = _interopRequireDefault(require("./media/preview"));
473
480
  var _documents = _interopRequireDefault(require("./documents"));
474
481
  var _filter = _interopRequireDefault(require("./filter"));
475
482
  var _currencyContext = _interopRequireDefault(require("./currency-context"));
@@ -0,0 +1,28 @@
1
+ import { FC, IglooComponentProps } from '../types';
2
+ import './style';
3
+ export interface Props extends IglooComponentProps {
4
+ handleUpload?(file: File): PromiseLike<string>;
5
+ value?: (string | {
6
+ name: string;
7
+ status: 'failed';
8
+ errorMsg: string;
9
+ })[];
10
+ onChange?: (value: any) => void;
11
+ limit?: number;
12
+ limitErrorMessage?: Function | string;
13
+ descriptions?: any;
14
+ buttonText?: any;
15
+ samples?: Sample[];
16
+ className?: any;
17
+ id?: string;
18
+ bizKey?: string;
19
+ capture?: boolean;
20
+ disabled?: boolean;
21
+ }
22
+ export type Sample = {
23
+ src: string;
24
+ label?: string;
25
+ type?: 'good' | 'bad';
26
+ };
27
+ declare const UploadPhoto: FC<Props>;
28
+ export default UploadPhoto;
@@ -0,0 +1,79 @@
1
+ import React from 'react';
2
+ import { FormInstance } from 'antd/es/form';
3
+ import { FormItemConfig, FormItemExtraConfig, FormItemName, FormItemCopyValue, FormItemSelectValue, FormItemAssert, Rule } from '../types';
4
+ import { NamePath } from 'antd/es/form/interface';
5
+ export declare const calcNamePath: (parentName: FormItemName | undefined, name: FormItemName | undefined) => any[];
6
+ export declare const testAssert: (form: FormInstance, assert: FormItemAssert) => boolean;
7
+ export declare const calcFormItemProps: (config: FormItemConfig, extraProps: FormItemExtraConfig, form?: FormInstance, parentName?: FormItemName, validationCodeExtraParams?: Record<string, any>) => {
8
+ colProps: {
9
+ span: number;
10
+ xs: number;
11
+ sm: number;
12
+ md: number;
13
+ halfRow: boolean | undefined;
14
+ };
15
+ formItemProps: {
16
+ name: any[];
17
+ className: string | undefined;
18
+ initialValue: any;
19
+ copiedValue: {
20
+ copied: boolean;
21
+ value?: undefined;
22
+ disabled?: undefined;
23
+ } | {
24
+ copied: boolean;
25
+ value: any;
26
+ disabled: boolean | undefined;
27
+ };
28
+ selectedValue: {
29
+ selected: boolean;
30
+ value?: undefined;
31
+ disabled?: undefined;
32
+ } | {
33
+ selected: boolean;
34
+ value: any;
35
+ disabled: boolean | undefined;
36
+ };
37
+ normalize: ((value: any, prevValue: any, allValues: import("rc-field-form/lib/interface").Store) => any) | undefined;
38
+ rules: Rule[];
39
+ validateTrigger: any[];
40
+ label: import("react/jsx-runtime").JSX.Element | null;
41
+ getValueFromEvent: ((...args: import("rc-field-form/lib/interface").EventArgs) => any) | undefined;
42
+ getValueProps: ((value: any) => Record<string, unknown>) | undefined;
43
+ extra: false | "" | 0 | import("react/jsx-runtime").JSX.Element | null | undefined;
44
+ help: React.ReactNode;
45
+ valuePropName: string | undefined;
46
+ messageVariables: {
47
+ label: string;
48
+ };
49
+ dependencies: any[] | undefined;
50
+ };
51
+ elementProps: {
52
+ [key: string]: any;
53
+ };
54
+ display: any;
55
+ previewFormater: ((value: any, form?: FormInstance<any> | undefined) => any) | undefined;
56
+ };
57
+ export declare const calcDisabled: (disabled?: boolean | FormItemAssert | FormItemAssert[], form?: FormInstance, disabledCode?: string, name?: FormItemName, parentName?: FormItemName) => any;
58
+ export declare const calcCopyValue: (copyValue?: FormItemCopyValue, form?: FormInstance) => {
59
+ copied: boolean;
60
+ value?: undefined;
61
+ disabled?: undefined;
62
+ } | {
63
+ copied: boolean;
64
+ value: any;
65
+ disabled: boolean | undefined;
66
+ };
67
+ export declare const calcSelectValue: (selectValue?: FormItemSelectValue[], form?: FormInstance) => {
68
+ selected: boolean;
69
+ value?: undefined;
70
+ disabled?: undefined;
71
+ } | {
72
+ selected: boolean;
73
+ value: any;
74
+ disabled: boolean | undefined;
75
+ };
76
+ export declare const calcShouldRender: (name: NamePath, parentName: NamePath, dependencies?: NamePath[], asserts?: FormItemAssert[], shouldRender?: ((form?: FormInstance) => boolean) | undefined, shouldRenderCode?: string, form?: FormInstance) => any;
77
+ export declare const automaticCalculate: (name: NamePath, parentName: NamePath, automaticCalcCode?: string, form?: FormInstance) => void;
78
+ export declare const getRuleValidation: (url: string, rule: string | string[], values?: any, lang?: string) => Promise<any>;
79
+ export declare const calcAddableSectionAssertField: (name: any[], field: FormItemAssert['field'], index: number, elements: FormItemConfig[] | React.ReactElement[]) => any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iglooform",
3
- "version": "3.4.1",
3
+ "version": "3.5.0",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "build-dev": "dumi build",
@@ -1 +0,0 @@
1
- export default function EmptyRoute(): import("react/jsx-runtime").JSX.Element;
@@ -1,22 +0,0 @@
1
- import type { IRuntimeConfig as Plugin0 } from '/Users/lei/iglooform/.dumi/tmp/plugin-antd/runtimeConfig.d';
2
- interface IDefaultRuntimeConfig {
3
- onRouteChange?: (props: {
4
- routes: any;
5
- clientRoutes: any;
6
- location: any;
7
- action: any;
8
- isFirst: boolean;
9
- }) => void;
10
- patchRoutes?: (props: {
11
- routes: any;
12
- }) => void;
13
- patchClientRoutes?: (props: {
14
- routes: any;
15
- }) => void;
16
- render?: (oldRender: () => void) => void;
17
- rootContainer?: (lastRootContainer: JSX.Element, args?: any) => void;
18
- [key: string]: any;
19
- }
20
- export type RuntimeConfig = IDefaultRuntimeConfig & Plugin0;
21
- export declare function defineApp(config: RuntimeConfig): RuntimeConfig;
22
- export {};
@@ -1 +0,0 @@
1
- export declare function modifyClientRenderOpts(memo: any): any;
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- import { HelmetProvider } from '/Users/lei/iglooform/node_modules/@umijs/renderer-react';
3
- export declare const innerProvider: (container: any) => React.CElement<React.PropsWithChildren<import("react-helmet-async").ProviderProps>, HelmetProvider>;
@@ -1 +0,0 @@
1
- export declare const context: {};
@@ -1,4 +0,0 @@
1
- import type { UmiHistory } from './historyIntelli';
2
- declare let history: UmiHistory;
3
- export declare function createHistory(opts: any): import("history").HashHistory;
4
- export { history };
@@ -1,50 +0,0 @@
1
- import { getRoutes } from './route';
2
- import type { History } from '/Users/lei/iglooform/node_modules/@umijs/renderer-react';
3
- type Routes = Awaited<ReturnType<typeof getRoutes>>['routes'];
4
- type AllRoute = Routes[keyof Routes];
5
- type IsRoot<T extends any> = 'parentId' extends keyof T ? false : true;
6
- type GetAllRouteWithoutLayout<Item extends AllRoute> = Item extends any ? 'isWrapper' extends keyof Item ? never : 'isLayout' extends keyof Item ? never : Item : never;
7
- type AllRouteWithoutLayout = GetAllRouteWithoutLayout<AllRoute>;
8
- type IndexRoutePathname = '/' extends AllRouteWithoutLayout['path'] ? '/' : never;
9
- type GetChildrens<T extends any> = T extends any ? IsRoot<T> extends true ? never : T : never;
10
- type Childrens = GetChildrens<AllRoute>;
11
- type Root = Exclude<AllRoute, Childrens>;
12
- type AllIds = AllRoute['id'];
13
- type GetChildrensByParentId<Id extends AllIds, Item = AllRoute> = Item extends any ? 'parentId' extends keyof Item ? Item['parentId'] extends Id ? Item : never : never : never;
14
- type RouteObject<Id extends AllIds, Item = GetChildrensByParentId<Id>> = IsNever<Item> extends true ? '' : Item extends AllRoute ? {
15
- [Key in Item['path'] as TrimSlash<Key>]: UnionMerge<RouteObject<Item['id']>>;
16
- } : never;
17
- type GetRootRouteObject<Item extends Root> = Item extends Root ? {
18
- [K in Item['path'] as TrimSlash<K>]: UnionMerge<RouteObject<Item['id']>>;
19
- } : never;
20
- type MergedResult = UnionMerge<GetRootRouteObject<Root>>;
21
- type HistoryTo = Parameters<History['push']>['0'];
22
- type HistoryPath = Exclude<HistoryTo, string>;
23
- type UmiPathname = Path<MergedResult> | (string & {});
24
- interface UmiPath extends HistoryPath {
25
- pathname: UmiPathname;
26
- }
27
- type UmiTo = UmiPathname | UmiPath;
28
- type UmiPush = (to: UmiTo, state?: any) => void;
29
- type UmiReplace = (to: UmiTo, state?: any) => void;
30
- export interface UmiHistory extends History {
31
- push: UmiPush;
32
- replace: UmiReplace;
33
- }
34
- type TrimLeftSlash<T extends string> = T extends `/${infer R}` ? TrimLeftSlash<R> : T;
35
- type TrimRightSlash<T extends string> = T extends `${infer R}/` ? TrimRightSlash<R> : T;
36
- type TrimSlash<T extends string> = TrimLeftSlash<TrimRightSlash<T>>;
37
- type IsNever<T> = [T] extends [never] ? true : false;
38
- type IsEqual<A, B> = (<G>() => G extends A ? 1 : 2) extends <G>() => G extends B ? 1 : 2 ? true : false;
39
- type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
40
- type UnionMerge<U> = UnionToIntersection<U> extends infer O ? {
41
- [K in keyof O]: O[K];
42
- } : never;
43
- type ExcludeEmptyKey<T> = IsEqual<T, ''> extends true ? never : T;
44
- type PathConcat<TKey extends string, TValue, N = TrimSlash<TKey>> = TValue extends string ? ExcludeEmptyKey<N> : ExcludeEmptyKey<N> | `${N & string}${IsNever<ExcludeEmptyKey<N>> extends true ? '' : '/'}${UnionPath<TValue>}`;
45
- type UnionPath<T> = {
46
- [K in keyof T]-?: PathConcat<K & string, T[K]>;
47
- }[keyof T];
48
- type MakeSureLeftSlash<T> = T extends any ? `/${TrimRightSlash<T & string>}` : never;
49
- type Path<T, K = UnionPath<T>> = Exclude<MakeSureLeftSlash<K>, '/*'> | IndexRoutePathname;
50
- export {};
@@ -1,25 +0,0 @@
1
- import * as Plugin_0 from '@@/core/exportStaticRuntimePlugin.ts';
2
- import * as Plugin_1 from '@@/core/helmet.ts';
3
- import * as Plugin_2 from '@@/dumi/meta/runtime.ts';
4
- import * as Plugin_3 from '@@/dumi/locales/runtime.tsx';
5
- import * as Plugin_4 from '/Users/lei/iglooform/.dumi/tmp/plugin-antd/runtime.tsx';
6
- import { PluginManager } from 'umi';
7
- export declare function getPlugins(): ({
8
- apply: typeof Plugin_0;
9
- path: string | undefined;
10
- } | {
11
- apply: typeof Plugin_1;
12
- path: string | undefined;
13
- } | {
14
- apply: typeof Plugin_2;
15
- path: string | undefined;
16
- } | {
17
- apply: typeof Plugin_3;
18
- path: string | undefined;
19
- } | {
20
- apply: typeof Plugin_4;
21
- path: string | undefined;
22
- })[];
23
- export declare function getValidKeys(): string[];
24
- export declare function createPluginManager(): PluginManager;
25
- export declare function getPluginManager(): any;