@simpleform/render 4.1.26 → 4.1.28

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.
@@ -0,0 +1,5 @@
1
+ import React from "react";
2
+ export declare function isValidComponent(component?: unknown): boolean;
3
+ export declare const isValidElement: <T>(val?: T | React.ReactElement) => val is React.ReactElement;
4
+ export declare const createElement: (type: string | React.FunctionComponent<{}> | React.ComponentClass<{}, any>, props?: React.Attributes | null | undefined, ...children: React.ReactNode[]) => ReturnType<typeof React.createElement>;
5
+ export declare const cloneElement: (element: React.ReactElement<unknown, string | React.JSXElementConstructor<any>>, props?: (Partial<unknown> & React.Attributes) | undefined, ...children: React.ReactNode[]) => ReturnType<typeof React.cloneElement>;
@@ -1,4 +1,4 @@
1
- export * from './ReactIs';
1
+ export * from './framework';
2
2
  export * from './array';
3
3
  export * from './transform';
4
4
  export * from './object';
@@ -13,6 +13,6 @@ export declare const evalAttr: <V>(val: V, variables?: object, parser?: FormRend
13
13
  export declare const getInitialValues: <V>(widgetList?: WidgetList) => V | undefined;
14
14
  export declare const getFormComponent: (target?: any, widgets?: RegisteredComponents) => any;
15
15
  export declare const createFormElement: (target?: CustomUnionType, props?: unknown, widgets?: RegisteredComponents) => React.ReactNode;
16
- export declare const withSide: (target?: React.ReactNode, customRender?: CustomRenderType, side?: React.ReactNode, context?: WidgetContextProps) => string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined;
16
+ export declare const withSide: (target?: React.ReactNode, customRender?: CustomRenderType, side?: React.ReactNode, context?: WidgetContextProps) => string | number | boolean | Iterable<React.ReactNode> | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | null | undefined;
17
17
  export declare const renderWidgetItem: (formrender?: FormRenderProps["formrender"], target?: WidgetItem | ReactComponent<any> | React.ReactNode, baseOptions?: WidgetContextProps["_options"]) => any;
18
18
  export declare const renderWidgetList: (formrender?: FormRenderProps["formrender"], widgetList?: WidgetList, baseOptions?: WidgetContextProps["_options"]) => any;
@@ -2,33 +2,37 @@
2
2
  * 精确类型判断
3
3
  */
4
4
  export declare function getType<T>(obj: T): string;
5
- export declare function isBoolean<T>(data: T): boolean;
6
- export declare function isNumber<T>(data: T): boolean;
7
- export declare function isString<T>(data: T): boolean;
8
- export declare function isFunction<T>(data: T): boolean;
9
- export declare function isArray<T>(data: T): boolean;
10
- export declare function isDate<T>(data: T): data is T & Date;
11
- export declare function isRegExp<T>(data: T): boolean;
12
- export declare function isUndefined<T>(data: T): boolean;
13
- export declare function isNull<T>(data: T): boolean;
14
- export declare function isObject<T>(data: T): boolean;
15
- export declare function isElement<T>(data: T): data is T & Element;
5
+ export declare function isBoolean<T>(data: T | boolean): data is boolean;
6
+ export declare function isNumber<T>(data: T | number): data is number;
7
+ export declare function isString<T>(data: T | string): data is string;
8
+ export declare function isFunction<T>(data: T | Function): data is Function;
9
+ export declare function isArray<T>(data: T | unknown[]): data is unknown[];
10
+ export declare function isDate<T>(data: T | Date): data is Date;
11
+ export declare function isRegExp<T>(data: T | RegExp): data is RegExp;
12
+ export declare function isUndefined<T>(data: T | undefined): data is undefined;
13
+ export declare function isNull<T>(data: T | null): data is null;
14
+ export declare function isObject<T>(data: T | object): data is object;
15
+ export declare function isElement<T>(data: T | Element): data is Element;
16
16
  export declare function isDom<T>(data: T & {
17
17
  nodeType?: number;
18
18
  nodeName?: string;
19
- }): boolean;
20
- export declare function isNodeList<T>(data: T): boolean;
21
- export declare function isEmpty<T>(value: T): boolean | undefined;
22
- export declare function isArrayBuffer<T>(data: T): boolean;
23
- export declare function isFormData<T>(data: T): boolean;
19
+ } | HTMLElement): data is HTMLElement;
20
+ export declare function isNodeList<T>(data: T | NodeList): data is NodeList;
21
+ type EmptyType = undefined | null | '' | [] | {};
22
+ export declare function isEmpty<T>(value: T | EmptyType): value is EmptyType;
23
+ export declare function isArrayBuffer<T>(data: T | ArrayBuffer): data is ArrayBuffer;
24
+ export declare function isFormData<T>(data: T | FormData): data is FormData;
24
25
  export declare function isArrayBufferView<T>(data: T & {
25
26
  buffer?: ArrayBuffer;
26
27
  }): any;
27
- export declare function isFile<T>(data: T): boolean;
28
- export declare function isBlob<T>(data: T): boolean;
28
+ export declare function isFile<T>(data: T | File): data is File;
29
+ export declare function isBlob<T>(data: T | Blob): data is Blob;
29
30
  export declare function isStream<T>(data: T & {
30
31
  pipe?: Function;
31
32
  }): boolean;
32
- export declare function isBase<T>(data: T): boolean;
33
- export declare const isNumberStr: <T>(str?: T) => true | undefined;
34
- export declare const isBase64: <T>(str?: T) => boolean | undefined;
33
+ type BaseTypes = string | number | symbol | boolean;
34
+ export declare function isBase<T>(data: T | BaseTypes): data is BaseTypes;
35
+ type NumberOrStr = string | number;
36
+ export declare const isNumberStr: <T>(str?: T | NumberOrStr) => str is NumberOrStr;
37
+ export declare const isBase64: <T>(str?: T) => boolean;
38
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simpleform/render",
3
- "version": "4.1.26",
3
+ "version": "4.1.28",
4
4
  "description": "dynamic rendering core of simple form",
5
5
  "author": "mezhanglei <496623925@qq.com>",
6
6
  "homepage": "https://github.com/mezhanglei/simpleform#readme",
@@ -45,7 +45,7 @@
45
45
  "react-router-dom": "^6.19.0"
46
46
  },
47
47
  "dependencies": {
48
- "@simpleform/form": "^2.1.14",
48
+ "@simpleform/form": "^2.2.0",
49
49
  "classnames": "^2.3.2",
50
50
  "copy-anything": "^3.0.5",
51
51
  "serialize-javascript": "^6.0.2"
@@ -1 +0,0 @@
1
- export declare function isValidComponent(component?: unknown): boolean;