Comparing version 1.0.1 to 1.2.2
@@ -6,11 +6,47 @@ import React from 'react'; | ||
} | ||
interface ModalProps extends PlainObject { | ||
interface ModalComponentProps extends PlainObject { | ||
visible: boolean; | ||
show: (props?: PlainObject) => void; | ||
hide: () => void; | ||
updateArgs: (payload?: PlainObject) => void; | ||
didShowCallback: DidShowCallbackType[]; | ||
pushDidShowCallback: (cb: DidShowCallbackType) => void; | ||
} | ||
declare type ModalType = ModalProps | React.ComponentType; | ||
declare const useModal: () => ModalProps; | ||
declare const createModal: <T = any>(Comp: React.ComponentType<ModalProps | T>) => ModalType; | ||
interface UseModalProps extends ModalComponentProps { | ||
resolve: <T = any>(value?: T | PromiseLike<T>) => void; | ||
reject: UkyouPromiseType['reject']; | ||
destroy: () => void; | ||
} | ||
interface CreateModalType<T> { | ||
ukyouId: string; | ||
Modal: React.ComponentType<T>; | ||
modal: Omit<ModalComponentProps, 'didShowCallback' | 'pushDidShowCallback'>; | ||
show: (payload?: T) => Promise<any>; | ||
updateArgs: (payload?: T) => void; | ||
} | ||
interface UkyouPromiseType<T = any> { | ||
resolve: (value?: T | PromiseLike<T>) => void; | ||
reject: (reason?: any) => void; | ||
value: Promise<T>; | ||
} | ||
declare type DidShowCallbackType = () => void; | ||
export { ModalProps, ModalType, PlainObject, createModal, useModal }; | ||
declare function useModal(): UseModalProps; | ||
declare function useModalShow(cb: DidShowCallbackType): void; | ||
declare function UkyouProvider(props: React.ComponentProps<any>): JSX.Element; | ||
declare function createModal<T = PlainObject>(Comp: React.ComponentType): CreateModalType<T>; | ||
declare function createGlobalModal<T = any>(Comp: React.ComponentType): CreateModalType<T>; | ||
declare const antdModal: (modal: UseModalProps) => { | ||
visible: UseModalProps['visible']; | ||
onCancel: UseModalProps['hide']; | ||
afterClose: UseModalProps['destroy']; | ||
}; | ||
declare const antdDrawer: (modal: UseModalProps) => { | ||
visible: UseModalProps['visible']; | ||
onClose: UseModalProps['hide']; | ||
afterVisibleChange: (visible: boolean) => void; | ||
}; | ||
export { UkyouProvider, antdDrawer, antdModal, createGlobalModal, createModal, useModal, useModalShow }; |
{ | ||
"name": "ukyou", | ||
"version": "1.0.1", | ||
"main": "dist/esm/index.js", | ||
"version": "1.2.2", | ||
"main": "index.js", | ||
"typings": "dist/index.d.ts", | ||
@@ -40,2 +40,6 @@ "author": "wayne", | ||
], | ||
"dependencies": {}, | ||
"publishConfig": { | ||
"registry": "https://registry.npmjs.org" | ||
}, | ||
"scripts": { | ||
@@ -42,0 +46,0 @@ "build": "pnpm tsup", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14240
6
314
2
1