@riotjs/dom-bindings
Advanced tools
Comparing version 5.0.5 to 5.1.0
@@ -10,22 +10,22 @@ // Expressions | ||
export interface BaseExpressionData { | ||
export interface BaseExpressionData<Scope = any> { | ||
type: ExpressionType | ||
evaluate(scope: any): any | ||
evaluate(scope: Scope): any | ||
} | ||
export interface AttributeExpressionData extends BaseExpressionData { | ||
export interface AttributeExpressionData<Scope = any> extends BaseExpressionData { | ||
name: string | ||
} | ||
export interface EventExpressionData extends BaseExpressionData { | ||
export interface EventExpressionData<Scope = any> extends BaseExpressionData { | ||
name: string | ||
} | ||
export interface TextExpressionData extends BaseExpressionData { | ||
export interface TextExpressionData<Scope = any> extends BaseExpressionData { | ||
childNodeIndex: number | ||
} | ||
export interface ValueExpressionData extends BaseExpressionData {} | ||
export interface ValueExpressionData<Scope = any> extends BaseExpressionData {} | ||
export type ExpressionData = AttributeExpressionData | EventExpressionData | TextExpressionData | ValueExpressionData | ||
export type ExpressionData<Scope = any> = AttributeExpressionData<Scope> | EventExpressionData<Scope> | TextExpressionData<Scope> | ValueExpressionData<Scope> | ||
@@ -36,5 +36,5 @@ export interface Expression<Scope = any> { | ||
value: any | ||
mount(scope: Scope): Expression | ||
update(scope: Scope): Expression | ||
unmount(scope: Scope): Expression | ||
mount(scope: Scope): Expression<Scope> | ||
update(scope: Scope): Expression<Scope> | ||
unmount(scope: Scope): Expression<Scope> | ||
} | ||
@@ -51,43 +51,43 @@ | ||
export interface BaseBindingData { | ||
export interface BaseBindingData<Scope = any> { | ||
selector?: string | ||
redundantAttribute?: string | ||
type?: BindingType | ||
evaluate?(scope: any): any | ||
evaluate?(scope: Scope): any | ||
} | ||
export interface EachBindingData extends BaseBindingData { | ||
export interface EachBindingData<Scope = any> extends BaseBindingData { | ||
itemName: string | ||
indexName?: number | ||
template: TemplateChunk | ||
getKey?: ((scope: any) => any) | null | ||
condition?: ((scope: any) => any) | null | ||
template: TemplateChunk<Scope> | ||
getKey?: ((scope: Scope) => any) | null | ||
condition?: ((scope: Scope) => any) | null | ||
} | ||
export interface IfBindingData extends BaseBindingData { | ||
template: TemplateChunk | ||
export interface IfBindingData<Scope = any> extends BaseBindingData { | ||
template: TemplateChunk<Scope> | ||
} | ||
export interface SimpleBindingData extends BaseBindingData { | ||
expressions: ExpressionData[] | ||
export interface SimpleBindingData<Scope = any> extends BaseBindingData { | ||
expressions: ExpressionData<Scope>[] | ||
} | ||
export interface SlotBindingData extends BaseBindingData { | ||
export interface SlotBindingData<Scope = any> extends BaseBindingData { | ||
id: string | ||
html: string | ||
bindings: BindingData | ||
bindings: BindingData<Scope> | ||
} | ||
export interface TagBindingData extends BaseBindingData { | ||
getComponent(name: string): TemplateChunk | ||
attributes: AttributeExpressionData[] | ||
slots: SlotBindingData[] | ||
export interface TagBindingData<Scope = any> extends BaseBindingData { | ||
getComponent(name: string): TemplateChunk<Scope> | ||
attributes: AttributeExpressionData<Scope>[] | ||
slots: SlotBindingData<Scope>[] | ||
} | ||
export type BindingData = IfBindingData | EachBindingData | SimpleBindingData | SlotBindingData | TagBindingData | ||
export type BindingData<Scope = any> = IfBindingData<Scope> | EachBindingData<Scope> | SimpleBindingData<Scope> | SlotBindingData<Scope> | TagBindingData<Scope> | ||
export interface Binding<Scope = any, ParentScope = any> { | ||
mount(el: HTMLElement, scope: Scope, parentScope?: ParentScope, meta?: TemplateChunkMeta): Binding | ||
update(scope: Scope, parentScope?: ParentScope): Binding | ||
unmount(scope: Scope, parentScope?: ParentScope, mustRemoveRoot?: boolean): Binding | ||
mount(el: HTMLElement, scope: Scope, parentScope?: ParentScope, meta?: TemplateChunkMeta): Binding<Scope, ParentScope> | ||
update(scope: Scope, parentScope?: ParentScope): Binding<Scope, ParentScope> | ||
unmount(scope: Scope, parentScope?: ParentScope, mustRemoveRoot?: boolean): Binding<Scope, ParentScope> | ||
} | ||
@@ -111,3 +111,3 @@ | ||
bindings?: Binding<Scope, ParentScope>[] | ||
bindingsData?: BindingData[] | ||
bindingsData?: BindingData<Scope>[] | ||
html?: string | null | ||
@@ -122,7 +122,7 @@ isTemplateTag?: boolean | ||
// API | ||
export function template(template: string, bindings: BindingData[]): TemplateChunk | ||
export function createBinding(root: HTMLElement, binding: BindingData, templateTagOffset?: number | null): Binding | ||
export function createExpression(node: HTMLElement, expression: ExpressionData): Expression | ||
export function template<Scope = any, ParentScope = any>(template: string, bindings?: BindingData<Scope>[]): TemplateChunk<Scope, ParentScope> | ||
export function createBinding<Scope = any>(root: HTMLElement, binding: BindingData<Scope>, templateTagOffset?: number | null): Binding<Scope> | ||
export function createExpression<Scope = any>(node: HTMLElement, expression: ExpressionData<Scope>): Expression<Scope> | ||
export const bindingTypes:BindingType | ||
export const expressionTypes:ExpressionType | ||
{ | ||
"name": "@riotjs/dom-bindings", | ||
"version": "5.0.5", | ||
"version": "5.1.0", | ||
"description": "Riot.js DOM bindings", | ||
@@ -5,0 +5,0 @@ "main": "dist/umd.dom-bindings.js", |
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
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
114202