nerv-shared
Advanced tools
+11
-0
@@ -6,2 +6,13 @@ # Change Log | ||
| <a name="1.4.0-beta.0"></a> | ||
| # [1.4.0-beta.0](https://github.com/NervJS/nerv/compare/v1.3.12...v1.4.0-beta.0) (2019-04-10) | ||
| ### Features | ||
| * implementing useLayoutEffect ([f56920d](https://github.com/NervJS/nerv/commit/f56920d)) | ||
| <a name="1.3.7"></a> | ||
@@ -8,0 +19,0 @@ ## [1.3.7](https://github.com/NervJS/nerv/compare/v1.3.6...v1.3.7) (2018-10-26) |
+1
-1
| { | ||
| "name": "nerv-shared", | ||
| "version": "1.3.7", | ||
| "version": "v1.4.0-beta.0", | ||
| "description": "Internal utilities for Nerv.js", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
-119
| // Generated by dts-bundle v0.7.3 | ||
| declare module 'nerv-shared' { | ||
| export interface Widget { | ||
| vtype: VType; | ||
| name: string; | ||
| _owner: any; | ||
| props: any; | ||
| _rendered: any; | ||
| context: any; | ||
| init(parentContext: any, parentComponent: any): Element | null; | ||
| update(previous: ComponentInstance, current: ComponentInstance, context: any, dom?: Element): Element | null; | ||
| destroy(dom?: Element): any; | ||
| } | ||
| export interface Portal { | ||
| type: Element; | ||
| vtype: VType; | ||
| children: VirtualNode; | ||
| dom: null | Element; | ||
| } | ||
| export type ComponentInstance = CompositeComponent | StatelessComponent; | ||
| export interface CompositeComponent extends Widget { | ||
| type: any; | ||
| component: Component<any, any>; | ||
| ref?: Ref; | ||
| dom: Element | null; | ||
| } | ||
| export interface StatelessComponent extends Widget { | ||
| type: Function; | ||
| dom: Element | null; | ||
| } | ||
| export const EMPTY_CHILDREN: never[]; | ||
| export const EMPTY_OBJ: {}; | ||
| export interface VText { | ||
| vtype: VType; | ||
| text: string | number; | ||
| dom: Text | null; | ||
| } | ||
| export interface VVoid { | ||
| dom: Text | null; | ||
| vtype: VType; | ||
| } | ||
| export interface VNode { | ||
| vtype: VType; | ||
| type: string; | ||
| props: Props; | ||
| children: VirtualChildren; | ||
| key: string | number | undefined; | ||
| namespace: string | null; | ||
| _owner: Component<any, any>; | ||
| isSvg?: boolean; | ||
| parentContext?: any; | ||
| dom: Element | null; | ||
| ref: Function | string | null; | ||
| } | ||
| export type VirtualNode = VNode | VText | CompositeComponent | StatelessComponent | VVoid | Portal; | ||
| export type VirtualChildren = Array<string | number | VirtualNode> | VirtualNode; | ||
| export type Ref = (node?: Element | null) => void | null | string; | ||
| export interface Props { | ||
| children?: VirtualChildren; | ||
| ref?: Ref; | ||
| key?: any; | ||
| className?: string | object; | ||
| [k: string]: any; | ||
| } | ||
| export interface ComponentLifecycle<P, S> { | ||
| componentWillMount?(): void; | ||
| componentDidMount?(): void; | ||
| componentWillReceiveProps?(nextProps: Readonly<P>, nextContext: any): void; | ||
| shouldComponentUpdate?(nextProps: Readonly<P>, nextState: Readonly<S>, nextContext: any): boolean; | ||
| componentWillUpdate?(nextProps: Readonly<P>, nextState: Readonly<S>, nextContext: any): void; | ||
| componentDidUpdate?(prevProps: Readonly<P>, prevState: Readonly<S>, prevContext: any): void; | ||
| componentWillUnmount?(): void; | ||
| componentDidCatch?(error?: any): void; | ||
| } | ||
| export interface Refs { | ||
| [k: string]: any; | ||
| } | ||
| export interface Component<P, S> extends ComponentLifecycle<P, S> { | ||
| state: Readonly<S>; | ||
| props: Readonly<P> & Readonly<any>; | ||
| context: any; | ||
| _dirty: boolean; | ||
| _disable: boolean; | ||
| _rendered: any; | ||
| _parentComponent: Component<any, any>; | ||
| prevProps: P; | ||
| prevState: S; | ||
| prevContext: object; | ||
| isReactComponent: object; | ||
| dom: any; | ||
| vnode: CompositeComponent; | ||
| clearCallBacks: () => void; | ||
| getState(): S; | ||
| refs: Refs; | ||
| render(): VirtualNode; | ||
| } | ||
| export function isNullOrUndef(o: any): o is undefined | null; | ||
| export function isInvalid(o: any): o is undefined | null | true | false; | ||
| export function isVNode(node: any): node is VNode; | ||
| export function isVText(node: any): node is VText; | ||
| export function isComponent(instance: any): instance is Component<any, any>; | ||
| export function isWidget(node: any): node is CompositeComponent | StatelessComponent; | ||
| export function isPortal(vtype: VType, node: any): node is Portal; | ||
| export function isComposite(node: any): node is CompositeComponent; | ||
| export function isStateless(node: any): node is StatelessComponent; | ||
| export function isValidElement(node: any): node is VirtualNode; | ||
| export function isHook(arg: any): boolean; | ||
| export function noop(): void; | ||
| export const enum VType { | ||
| Text = 1, | ||
| Node = 2, | ||
| Composite = 4, | ||
| Stateless = 8, | ||
| Void = 16, | ||
| Portal = 32, | ||
| } | ||
| } | ||
| const EMPTY_CHILDREN = []; | ||
| const EMPTY_OBJ = {}; | ||
| function isNullOrUndef(o) { | ||
| return o === undefined || o === null; | ||
| } | ||
| function isInvalid(o) { | ||
| return isNullOrUndef(o) || o === true || o === false; | ||
| } | ||
| function isVNode(node) { | ||
| return !isNullOrUndef(node) && node.vtype === 2 /* Node */; | ||
| } | ||
| function isVText(node) { | ||
| return !isNullOrUndef(node) && node.vtype === 1 /* Text */; | ||
| } | ||
| function isComponent(instance) { | ||
| return !isInvalid(instance) && instance.isReactComponent === EMPTY_OBJ; | ||
| } | ||
| function isWidget(node) { | ||
| return (!isNullOrUndef(node) && | ||
| (node.vtype & (4 /* Composite */ | 8 /* Stateless */)) > 0); | ||
| } | ||
| function isPortal(vtype, node) { | ||
| return (vtype & 32 /* Portal */) > 0; | ||
| } | ||
| function isComposite(node) { | ||
| return !isNullOrUndef(node) && node.vtype === 4 /* Composite */; | ||
| } | ||
| function isStateless(node) { | ||
| return !isNullOrUndef(node) && node.vtype === 8 /* Stateless */; | ||
| } | ||
| function isValidElement(node) { | ||
| return !isNullOrUndef(node) && node.vtype; | ||
| } | ||
| function isHook(arg) { | ||
| return !isNullOrUndef(arg) && typeof arg.vhook === 'number'; | ||
| } | ||
| // tslint:disable-next-line:no-empty | ||
| function noop() { } | ||
| // typescript will compile the enum's value for us. | ||
| // eg. | ||
| // Composite = 1 << 2 => Composite = 4 | ||
| var VType; | ||
| (function (VType) { | ||
| VType[VType["Text"] = 1] = "Text"; | ||
| VType[VType["Node"] = 2] = "Node"; | ||
| VType[VType["Composite"] = 4] = "Composite"; | ||
| VType[VType["Stateless"] = 8] = "Stateless"; | ||
| VType[VType["Void"] = 16] = "Void"; | ||
| VType[VType["Portal"] = 32] = "Portal"; | ||
| })(VType || (VType = {})); | ||
| export { EMPTY_CHILDREN, EMPTY_OBJ, isNullOrUndef, isInvalid, isVNode, isVText, isComponent, isWidget, isPortal, isComposite, isStateless, isValidElement, isHook, noop, VType }; | ||
| //# sourceMappingURL=index.js.map |
| {"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["export interface Widget {\n vtype: VType\n name: string\n _owner: any\n props: any\n _rendered: any\n context: any\n init (parentContext, parentComponent): Element | null\n update (\n previous: ComponentInstance,\n current: ComponentInstance,\n context: any,\n dom?: Element\n ): Element | null\n destroy (dom?: Element)\n}\n\nexport interface Portal {\n type: Element\n vtype: VType\n children: VirtualNode\n dom: null | Element\n}\n\nexport type ComponentInstance = CompositeComponent | StatelessComponent\n\nexport interface CompositeComponent extends Widget {\n type: any\n component: Component<any, any>\n ref?: Ref\n dom: Element | null\n}\n\nexport interface StatelessComponent extends Widget {\n type: Function\n dom: Element | null\n}\n\nexport const EMPTY_CHILDREN = []\n\nexport const EMPTY_OBJ = {}\n\nexport interface VText {\n vtype: VType\n text: string | number\n dom: Text | null\n}\n\nexport interface VVoid {\n dom: Text | null\n vtype: VType\n}\n\nexport interface VNode {\n vtype: VType\n type: string\n props: Props\n children: VirtualChildren\n key: string | number | undefined\n namespace: string | null\n _owner: Component<any, any> // TODO: this is a component\n isSvg?: boolean\n parentContext?: any\n dom: Element | null\n ref: Function | string | null\n}\n\nexport type VirtualNode =\n | VNode\n | VText\n | CompositeComponent\n | StatelessComponent\n | VVoid\n | Portal\n\nexport type VirtualChildren = Array<string | number | VirtualNode> | VirtualNode\n\nexport type Ref = (node?: Element | null) => void | null | string\n\nexport interface Props {\n children?: VirtualChildren\n ref?: Ref\n key?: any\n className?: string | object\n [k: string]: any\n}\n\nexport interface ComponentLifecycle<P, S> {\n componentWillMount? (): void\n componentDidMount? (): void\n componentWillReceiveProps? (nextProps: Readonly<P>, nextContext: any): void\n shouldComponentUpdate? (\n nextProps: Readonly<P>,\n nextState: Readonly<S>,\n nextContext: any\n ): boolean\n componentWillUpdate? (\n nextProps: Readonly<P>,\n nextState: Readonly<S>,\n nextContext: any\n ): void\n componentDidUpdate? (\n prevProps: Readonly<P>,\n prevState: Readonly<S>,\n prevContext: any\n ): void\n componentWillUnmount? (): void\n componentDidCatch? (error?): void\n}\n\nexport interface Refs {\n [k: string]: any\n}\n\nexport interface Component<P, S> extends ComponentLifecycle<P, S> {\n state: Readonly<S>\n props: Readonly<P> & Readonly<any>\n context: any\n _dirty: boolean\n _disable: boolean\n _rendered: any\n _parentComponent: Component<any, any>\n prevProps: P\n prevState: S\n prevContext: object\n isReactComponent: object\n dom: any\n vnode: CompositeComponent\n clearCallBacks: () => void\n getState (): S\n // tslint:disable-next-line:member-ordering\n refs: Refs\n render (): VirtualNode\n}\n\nexport function isNullOrUndef (o: any): o is undefined | null {\n return o === undefined || o === null\n}\n\nexport function isInvalid (o: any): o is undefined | null | true | false {\n return isNullOrUndef(o) || o === true || o === false\n}\n\nexport function isVNode (node): node is VNode {\n return !isNullOrUndef(node) && node.vtype === VType.Node\n}\n\nexport function isVText (node): node is VText {\n return !isNullOrUndef(node) && node.vtype === VType.Text\n}\n\nexport function isComponent (instance): instance is Component<any, any> {\n return !isInvalid(instance) && instance.isReactComponent === EMPTY_OBJ\n}\n\nexport function isWidget (\n node\n): node is CompositeComponent | StatelessComponent {\n return (\n !isNullOrUndef(node) &&\n (node.vtype & (VType.Composite | VType.Stateless)) > 0\n )\n}\n\nexport function isPortal (vtype: VType, node): node is Portal {\n return (vtype & VType.Portal) > 0\n}\n\nexport function isComposite (node): node is CompositeComponent {\n return !isNullOrUndef(node) && node.vtype === VType.Composite\n}\n\nexport function isStateless (node): node is StatelessComponent {\n return !isNullOrUndef(node) && node.vtype === VType.Stateless\n}\n\nexport function isValidElement (node): node is VirtualNode {\n return !isNullOrUndef(node) && node.vtype\n}\n\nexport function isHook (arg) {\n return !isNullOrUndef(arg) && typeof arg.vhook === 'number'\n}\n\n// tslint:disable-next-line:no-empty\nexport function noop () {}\n\n// typescript will compile the enum's value for us.\n// eg.\n// Composite = 1 << 2 => Composite = 4\nexport const enum VType {\n Text = 1,\n Node = 1 << 1,\n Composite = 1 << 2,\n Stateless = 1 << 3,\n Void = 1 << 4,\n Portal = 1 << 5\n}\n"],"names":[],"mappings":"AAsCO,MAAM,cAAc,GAAG,EAAE,CAAA;AAEhC,AAAO,MAAM,SAAS,GAAG,EAAE,CAAA;AA+F3B,uBAA+B,CAAM;IACnC,OAAO,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,IAAI,CAAA;CACrC;AAED,mBAA2B,CAAM;IAC/B,OAAO,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,KAAK,CAAA;CACrD;AAED,iBAAyB,IAAI;IAC3B,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,KAAK,kBAAe;CACzD;AAED,iBAAyB,IAAI;IAC3B,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,KAAK,kBAAe;CACzD;AAED,qBAA6B,QAAQ;IACnC,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,gBAAgB,KAAK,SAAS,CAAA;CACvE;AAED,kBACE,IAAI;IAEJ,QACE,CAAC,aAAa,CAAC,IAAI,CAAC;QACpB,CAAC,IAAI,CAAC,KAAK,IAAI,sCAAkC,IAAI,CAAC,EACvD;CACF;AAED,kBAA0B,KAAY,EAAE,IAAI;IAC1C,OAAO,CAAC,KAAK,sBAAmB,CAAC,CAAA;CAClC;AAED,qBAA6B,IAAI;IAC/B,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,KAAK,uBAAoB;CAC9D;AAED,qBAA6B,IAAI;IAC/B,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,KAAK,uBAAoB;CAC9D;AAED,wBAAgC,IAAI;IAClC,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,KAAK,CAAA;CAC1C;AAED,gBAAwB,GAAG;IACzB,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,OAAO,GAAG,CAAC,KAAK,KAAK,QAAQ,CAAA;CAC5D;;AAGD,mBAA0B;;;;AAK1B,AAAA,IAAkB,KAOjB;AAPD,WAAkB,KAAK;IACrB,iCAAQ,CAAA;IACR,iCAAa,CAAA;IACb,2CAAkB,CAAA;IAClB,2CAAkB,CAAA;IAClB,kCAAa,CAAA;IACb,sCAAe,CAAA;CAChB,EAPiB,KAAK,KAAL,KAAK,QAOtB;;;;"} |
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
15403
-43.37%4
-42.86%21
-88.95%2
100%1
Infinity%