@bikeshaving/crank
Advanced tools
Comparing version 0.1.2 to 0.1.3
@@ -5,3 +5,3 @@ 'use strict'; | ||
var index = require('./index-d9e2b4f7.js'); | ||
var index = require('./index-7c447649.js'); | ||
@@ -8,0 +8,0 @@ var _a; |
@@ -5,3 +5,3 @@ 'use strict'; | ||
var index = require('./index-d9e2b4f7.js'); | ||
var index = require('./index-7c447649.js'); | ||
@@ -8,0 +8,0 @@ var _a; |
import { CrankEventTarget } from "./events"; | ||
import { MaybePromise, MaybePromiseLike } from "./pledge"; | ||
export { EventMap } from "./events"; | ||
export declare type Tag = Component | string | symbol; | ||
declare global { | ||
module JSX { | ||
interface IntrinsicElements { | ||
[tag: string]: any; | ||
} | ||
interface ElementChildrenAttribute { | ||
children: {}; | ||
} | ||
} | ||
} | ||
export declare type Tag<TProps = any> = Component<TProps> | string | symbol; | ||
declare type TagProps<TTag extends Tag> = TTag extends Component<infer TProps> ? TProps : TTag extends string ? JSX.IntrinsicElements[TTag] : unknown; | ||
export declare type Key = unknown; | ||
@@ -13,3 +24,2 @@ export declare type Child = Element | string | number | boolean | null | undefined; | ||
children?: Children; | ||
[name: string]: any; | ||
} | ||
@@ -24,10 +34,10 @@ export interface IntrinsicProps<T> { | ||
readonly tag: TTag; | ||
props: Props; | ||
props: TagProps<TTag>; | ||
key?: unknown; | ||
} | ||
export declare type FunctionComponent = (this: Context, props: Props) => MaybePromiseLike<Child>; | ||
export declare type ChildIterator<T = any> = Iterator<Child, Child, T> | AsyncIterator<Child, Child, T>; | ||
export declare type ChildGenerator<T = any> = Generator<Child, Child, T> | AsyncGenerator<Child, Child, T>; | ||
export declare type GeneratorComponent = (this: Context, props: Props) => ChildIterator; | ||
export declare type Component = (this: Context, props: Props) => ChildIterator | MaybePromiseLike<Child>; | ||
export declare type FunctionComponent<TProps = any> = (this: Context<TProps>, props: TProps) => MaybePromiseLike<Child>; | ||
export declare type ChildIterator<TNext = any> = Iterator<Child, Child, TNext> | AsyncIterator<Child, Child, TNext>; | ||
export declare type ChildGenerator<TNext = any> = Generator<Child, Child, TNext> | AsyncGenerator<Child, Child, TNext>; | ||
export declare type GeneratorComponent<TProps = any> = (this: Context<TProps>, props: TProps) => ChildIterator; | ||
export declare type Component<TProps = any> = (this: Context<TProps>, props: TProps) => ChildIterator | MaybePromiseLike<Child>; | ||
export declare type Intrinsic<T> = (this: HostContext, props: IntrinsicProps<T>) => Iterator<T> | T; | ||
@@ -42,14 +52,4 @@ export declare const Fragment: any; | ||
export declare type Raw = typeof Raw; | ||
declare global { | ||
module JSX { | ||
interface IntrinsicElements { | ||
[tag: string]: any; | ||
} | ||
interface ElementChildrenAttribute { | ||
children: {}; | ||
} | ||
} | ||
} | ||
export declare function isElement(value: any): value is Element; | ||
export declare function createElement<TTag extends Tag>(tag: TTag, props?: Props | null, ...children: Array<Children>): Element<TTag>; | ||
export declare function createElement<TTag extends Tag>(tag: TTag, props?: TagProps<TTag> | null, ...children: Array<unknown>): Element<TTag>; | ||
declare type Node<T> = LeafNode<T> | ParentNode<T>; | ||
@@ -90,3 +90,3 @@ interface NodeBase<T> { | ||
private onNextResult; | ||
protected props: Props | undefined; | ||
protected props: any; | ||
value: Array<T | string> | T | string | undefined; | ||
@@ -105,3 +105,3 @@ ctx: Context | undefined; | ||
protected unmountChildren(): void; | ||
update(props: Props): MaybePromise<undefined>; | ||
update(props: any): MaybePromise<undefined>; | ||
refresh(): MaybePromise<undefined>; | ||
@@ -125,9 +125,6 @@ abstract commit(): MaybePromise<undefined>; | ||
unmount(): MaybePromise<undefined>; | ||
[Symbol.iterator](): Generator<{ | ||
children: (string | T)[]; | ||
"crank-key"?: unknown; | ||
}, void, unknown>; | ||
[Symbol.iterator](): Generator<any, void, unknown>; | ||
} | ||
declare class ComponentNode<T> extends ParentNode<T> { | ||
readonly tag: Component; | ||
declare class ComponentNode<T, TProps> extends ParentNode<T> { | ||
readonly tag: Component<TProps>; | ||
readonly key: Key; | ||
@@ -159,4 +156,4 @@ readonly parent: ParentNode<T>; | ||
set(name: unknown, value: any): void; | ||
[Symbol.iterator](): Generator<Props>; | ||
[Symbol.asyncIterator](): AsyncGenerator<Props>; | ||
[Symbol.iterator](): Generator<TProps>; | ||
[Symbol.asyncIterator](): AsyncGenerator<TProps>; | ||
} | ||
@@ -169,4 +166,4 @@ export declare class HostContext<T = any> { | ||
} | ||
export declare class Context extends CrankEventTarget { | ||
constructor(host: ComponentNode<any>, parent?: Context); | ||
export declare class Context<TProps = any> extends CrankEventTarget { | ||
constructor(host: ComponentNode<any, TProps>, parent?: Context<TProps>); | ||
get<T extends keyof ProvisionMap>(name: T): ProvisionMap[T]; | ||
@@ -176,4 +173,4 @@ get(name: any): any; | ||
set(name: any, value: any): void; | ||
[Symbol.iterator](): Generator<Props>; | ||
[Symbol.asyncIterator](): AsyncGenerator<Props>; | ||
[Symbol.iterator](): Generator<TProps>; | ||
[Symbol.asyncIterator](): AsyncGenerator<TProps>; | ||
refresh(): MaybePromise<undefined>; | ||
@@ -195,5 +192,5 @@ } | ||
extend(env: Partial<Environment<T>>): void; | ||
render(child: Child, root?: object): MaybePromise<T>; | ||
render(children: Children, root?: object): MaybePromise<T>; | ||
intrinsic(tag: string | symbol): Intrinsic<T>; | ||
text(text: string): string; | ||
} |
@@ -5,3 +5,3 @@ 'use strict'; | ||
var index = require('./index-d9e2b4f7.js'); | ||
var index = require('./index-7c447649.js'); | ||
@@ -8,0 +8,0 @@ |
@@ -1,2 +0,2 @@ | ||
import { D as Default, _ as __generator, R as Raw, P as Portal, d as __extends, b as Renderer, e as __rest, f as __values, g as __assign } from './index-ff226fef.js'; | ||
import { D as Default, _ as __generator, R as Raw, P as Portal, d as __extends, b as Renderer, e as __rest, f as __values, g as __assign } from './index-0daa0e1a.js'; | ||
@@ -3,0 +3,0 @@ var _a; |
@@ -1,2 +0,2 @@ | ||
import { D as Default, T as Text, P as Portal, d as __extends, f as __values, h as __read, b as Renderer } from './index-ff226fef.js'; | ||
import { D as Default, T as Text, P as Portal, d as __extends, f as __values, h as __read, b as Renderer } from './index-0daa0e1a.js'; | ||
@@ -3,0 +3,0 @@ var _a; |
import { CrankEventTarget } from "./events"; | ||
import { MaybePromise, MaybePromiseLike } from "./pledge"; | ||
export { EventMap } from "./events"; | ||
export declare type Tag = Component | string | symbol; | ||
declare global { | ||
module JSX { | ||
interface IntrinsicElements { | ||
[tag: string]: any; | ||
} | ||
interface ElementChildrenAttribute { | ||
children: {}; | ||
} | ||
} | ||
} | ||
export declare type Tag<TProps = any> = Component<TProps> | string | symbol; | ||
declare type TagProps<TTag extends Tag> = TTag extends Component<infer TProps> ? TProps : TTag extends string ? JSX.IntrinsicElements[TTag] : unknown; | ||
export declare type Key = unknown; | ||
@@ -13,3 +24,2 @@ export declare type Child = Element | string | number | boolean | null | undefined; | ||
children?: Children; | ||
[name: string]: any; | ||
} | ||
@@ -24,10 +34,10 @@ export interface IntrinsicProps<T> { | ||
readonly tag: TTag; | ||
props: Props; | ||
props: TagProps<TTag>; | ||
key?: unknown; | ||
} | ||
export declare type FunctionComponent = (this: Context, props: Props) => MaybePromiseLike<Child>; | ||
export declare type ChildIterator<T = any> = Iterator<Child, Child, T> | AsyncIterator<Child, Child, T>; | ||
export declare type ChildGenerator<T = any> = Generator<Child, Child, T> | AsyncGenerator<Child, Child, T>; | ||
export declare type GeneratorComponent = (this: Context, props: Props) => ChildIterator; | ||
export declare type Component = (this: Context, props: Props) => ChildIterator | MaybePromiseLike<Child>; | ||
export declare type FunctionComponent<TProps = any> = (this: Context<TProps>, props: TProps) => MaybePromiseLike<Child>; | ||
export declare type ChildIterator<TNext = any> = Iterator<Child, Child, TNext> | AsyncIterator<Child, Child, TNext>; | ||
export declare type ChildGenerator<TNext = any> = Generator<Child, Child, TNext> | AsyncGenerator<Child, Child, TNext>; | ||
export declare type GeneratorComponent<TProps = any> = (this: Context<TProps>, props: TProps) => ChildIterator; | ||
export declare type Component<TProps = any> = (this: Context<TProps>, props: TProps) => ChildIterator | MaybePromiseLike<Child>; | ||
export declare type Intrinsic<T> = (this: HostContext, props: IntrinsicProps<T>) => Iterator<T> | T; | ||
@@ -42,14 +52,4 @@ export declare const Fragment: any; | ||
export declare type Raw = typeof Raw; | ||
declare global { | ||
module JSX { | ||
interface IntrinsicElements { | ||
[tag: string]: any; | ||
} | ||
interface ElementChildrenAttribute { | ||
children: {}; | ||
} | ||
} | ||
} | ||
export declare function isElement(value: any): value is Element; | ||
export declare function createElement<TTag extends Tag>(tag: TTag, props?: Props | null, ...children: Array<Children>): Element<TTag>; | ||
export declare function createElement<TTag extends Tag>(tag: TTag, props?: TagProps<TTag> | null, ...children: Array<unknown>): Element<TTag>; | ||
declare type Node<T> = LeafNode<T> | ParentNode<T>; | ||
@@ -90,3 +90,3 @@ interface NodeBase<T> { | ||
private onNextResult; | ||
protected props: Props | undefined; | ||
protected props: any; | ||
value: Array<T | string> | T | string | undefined; | ||
@@ -105,3 +105,3 @@ ctx: Context | undefined; | ||
protected unmountChildren(): void; | ||
update(props: Props): MaybePromise<undefined>; | ||
update(props: any): MaybePromise<undefined>; | ||
refresh(): MaybePromise<undefined>; | ||
@@ -125,9 +125,6 @@ abstract commit(): MaybePromise<undefined>; | ||
unmount(): MaybePromise<undefined>; | ||
[Symbol.iterator](): Generator<{ | ||
children: (string | T)[]; | ||
"crank-key"?: unknown; | ||
}, void, unknown>; | ||
[Symbol.iterator](): Generator<any, void, unknown>; | ||
} | ||
declare class ComponentNode<T> extends ParentNode<T> { | ||
readonly tag: Component; | ||
declare class ComponentNode<T, TProps> extends ParentNode<T> { | ||
readonly tag: Component<TProps>; | ||
readonly key: Key; | ||
@@ -159,4 +156,4 @@ readonly parent: ParentNode<T>; | ||
set(name: unknown, value: any): void; | ||
[Symbol.iterator](): Generator<Props>; | ||
[Symbol.asyncIterator](): AsyncGenerator<Props>; | ||
[Symbol.iterator](): Generator<TProps>; | ||
[Symbol.asyncIterator](): AsyncGenerator<TProps>; | ||
} | ||
@@ -169,4 +166,4 @@ export declare class HostContext<T = any> { | ||
} | ||
export declare class Context extends CrankEventTarget { | ||
constructor(host: ComponentNode<any>, parent?: Context); | ||
export declare class Context<TProps = any> extends CrankEventTarget { | ||
constructor(host: ComponentNode<any, TProps>, parent?: Context<TProps>); | ||
get<T extends keyof ProvisionMap>(name: T): ProvisionMap[T]; | ||
@@ -176,4 +173,4 @@ get(name: any): any; | ||
set(name: any, value: any): void; | ||
[Symbol.iterator](): Generator<Props>; | ||
[Symbol.asyncIterator](): AsyncGenerator<Props>; | ||
[Symbol.iterator](): Generator<TProps>; | ||
[Symbol.asyncIterator](): AsyncGenerator<TProps>; | ||
refresh(): MaybePromise<undefined>; | ||
@@ -195,5 +192,5 @@ } | ||
extend(env: Partial<Environment<T>>): void; | ||
render(child: Child, root?: object): MaybePromise<T>; | ||
render(children: Children, root?: object): MaybePromise<T>; | ||
intrinsic(tag: string | symbol): Intrinsic<T>; | ||
text(text: string): string; | ||
} |
@@ -1,2 +0,2 @@ | ||
export { a as Context, C as Copy, D as Default, F as Fragment, H as HostContext, P as Portal, R as Raw, b as Renderer, T as Text, c as createElement, i as isElement } from './index-ff226fef.js'; | ||
export { a as Context, C as Copy, D as Default, F as Fragment, H as HostContext, P as Portal, R as Raw, b as Renderer, T as Text, c as createElement, i as isElement } from './index-0daa0e1a.js'; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@bikeshaving/crank", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"license": "MIT", | ||
@@ -26,2 +26,5 @@ "description": "JSX-based components with functions, promises and generators.", | ||
}, | ||
"dependencies": { | ||
"event-target-shim": "^5.0.1" | ||
}, | ||
"devDependencies": { | ||
@@ -38,4 +41,5 @@ "@rollup/plugin-node-resolve": "^7.1.3", | ||
"eslint-plugin-react": "^7.19.0", | ||
"event-target-shim": "^5.0.1", | ||
"husky": "^3.1.0", | ||
"jest": "^25.3.0", | ||
"lint-staged": "^10.0.8", | ||
"prettier": "^2.0.4", | ||
@@ -46,7 +50,17 @@ "rollup": "^2.6.1", | ||
"ts-jest": "^25.3.1", | ||
"typescript": "^3.8.3" | ||
"typescript": "3.9.1-rc" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"husky": { | ||
"hooks": { | ||
"pre-commit": "lint-staged" | ||
} | ||
}, | ||
"lint-staged": { | ||
"**/*.{js,jsx,ts,tsx}": [ | ||
"eslint" | ||
] | ||
} | ||
} |
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
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
303408
1
19
+ Addedevent-target-shim@^5.0.1
+ Addedevent-target-shim@5.0.1(transitive)