Skip to content

Commit

Permalink
updated: improve typescript definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
GianlucaGuarini committed May 13, 2021
1 parent e65ebb6 commit 12c3054
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions dom-bindings.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ export interface BaseExpressionData<Scope = any> {
evaluate(scope: Scope): any
}

export interface AttributeExpressionData<Scope = any> extends BaseExpressionData {
export interface AttributeExpressionData<Scope = any> extends BaseExpressionData<Scope> {
name: string
}

export interface EventExpressionData<Scope = any> extends BaseExpressionData {
export interface EventExpressionData<Scope = any> extends BaseExpressionData<Scope> {
name: string
}

export interface TextExpressionData<Scope = any> extends BaseExpressionData {
export interface TextExpressionData<Scope = any> extends BaseExpressionData<Scope> {
childNodeIndex: number
}

export interface ValueExpressionData<Scope = any> extends BaseExpressionData {}
export interface ValueExpressionData<Scope = any> extends BaseExpressionData<Scope> {}

export type ExpressionData<Scope = any> = AttributeExpressionData<Scope> | EventExpressionData<Scope> | TextExpressionData<Scope> | ValueExpressionData<Scope>

Expand Down Expand Up @@ -53,29 +53,29 @@ export interface BaseBindingData<Scope = any> {
evaluate?(scope: Scope): any
}

export interface EachBindingData<Scope = any> extends BaseBindingData {
export interface EachBindingData<Scope = any> extends BaseBindingData<Scope> {
itemName: string
indexName?: number
template: TemplateChunk<Scope>
getKey?: ((scope: Scope) => any) | null
condition?: ((scope: Scope) => any) | null
}

export interface IfBindingData<Scope = any> extends BaseBindingData {
export interface IfBindingData<Scope = any> extends BaseBindingData<Scope> {
template: TemplateChunk<Scope>
}

export interface SimpleBindingData<Scope = any> extends BaseBindingData {
export interface SimpleBindingData<Scope = any> extends BaseBindingData<Scope> {
expressions: ExpressionData<Scope>[]
}

export interface SlotBindingData<Scope = any> extends BaseBindingData {
export interface SlotBindingData<Scope = any> extends BaseBindingData<Scope> {
id: string
html: string
bindings: BindingData<Scope>
bindings: BindingData<Scope>[]
}

export interface TagBindingData<Scope = any> extends BaseBindingData {
export interface TagBindingData<Scope = any> extends BaseBindingData<Scope> {
getComponent(name: string): TemplateChunk<Scope>
attributes: AttributeExpressionData<Scope>[]
slots: SlotBindingData<Scope>[]
Expand Down

0 comments on commit 12c3054

Please sign in to comment.