Interface KnockoutUtils

Index

Properties

Methods

Properties

public domData: { get(node: Element, key: string): any; set(node: Element, key: string, value: any): void; getAll(node: Element, createIfNotFound: boolean): any; clear(node: Element): boolean; }

public clear(): boolean

Returns

boolean

.node.node: Element

public get(): any

Returns

any

.key.key: string

.node.node: Element

public getAll(): any

Returns

any

.createIfNotFound.createIfNotFound: boolean

.node.node: Element

public set()

.key.key: string

.node.node: Element

.value.value: any

public domNodeDisposal: { addDisposeCallback(node: Element, callback: Function): void; removeDisposeCallback(node: Element, callback: Function): void; cleanNode(node: Element): Element; removeNode(node: Element): void; }

public addDisposeCallback()

.callback.callback: Function

.node.node: Element

public cleanNode(): Element

Returns

Element

.node.node: Element

public removeDisposeCallback()

.callback.callback: Function

.node.node: Element

public removeNode()

.node.node: Element

public fieldsIncludedWithJsonPost: Array<any>

public ieVersion: number

public isIe6: boolean

public isIe7: boolean

Methods

public arrayFilter(array: Array<T>, predicate: (item: T) => boolean): Array<T>

Parameters

  • array: Array<T>
  • predicate: (item: T) => boolean

Returns

Array<T>

public arrayFirst(array: Array<T>, predicate: (item: T) => boolean, predicateOwner?: any): T

Parameters

  • array: Array<T>
  • predicate: (item: T) => boolean
  • predicateOwner?: any optional

Returns

T

public arrayForEach(array: Array<T>, action: (item: T) => void)

Parameters

  • array: Array<T>
  • action: (item: T) => void

public arrayGetDistinctValues(array: Array<T>): Array<T>

Parameters

  • array: Array<T>

Returns

Array<T>

public arrayIndexOf(array: Array<T>, item: T): number

Parameters

  • array: Array<T>
  • item: T

Returns

number

public arrayMap(array: Array<T>, mapping: (item: T) => U): Array<U>

Parameters

  • array: Array<T>
  • mapping: (item: T) => U

Returns

Array<U>

public arrayPushAll(array: Array<T>, valuesToPush: Array<T>): Array<T>

Parameters

  • array: Array<T>
  • valuesToPush: Array<T>

Returns

Array<T>

public arrayPushAll(array: KnockoutObservableArray, valuesToPush: Array<T>): Array<T>

Parameters

Returns

Array<T>

public arrayRemoveItem(array: Array<any>, itemToRemove: any)

Parameters

  • array: Array<any>
  • itemToRemove: any

public cloneNodes(nodesArray: Array<any>, shouldCleanNodes: boolean): Array<any>

Parameters

  • nodesArray: Array<any>
  • shouldCleanNodes: boolean

Returns

Array<any>

public compareArrays(a: Array<T>, b: Array<T>): KnockoutArrayChange[]

Parameters

  • a: Array<T>
  • b: Array<T>

Returns

KnockoutArrayChange[]

public domNodeIsAttachedToDocument(node: any): boolean

Parameters

  • node: any

Returns

boolean

public domNodeIsContainedBy(node: any, containedByNode: any): boolean

Parameters

  • node: any
  • containedByNode: any

Returns

boolean

public emptyDomNode(domNode: HTMLElement)

Parameters

  • domNode: HTMLElement

public ensureSelectElementIsRenderedCorrectly(selectElement: any)

Parameters

  • selectElement: any

public extend(target: Object, source: Object): Object

Parameters

  • target: Object
  • source: Object

Returns

Object

public forceRefresh(node: any)

Parameters

  • node: any

public getFormFields(form: any, fieldName: string): Array<any>

Parameters

  • form: any
  • fieldName: string

Returns

Array<any>

public jQueryHtmlParse(html: string): Array<any>

Parameters

  • html: string

Returns

Array<any>

public makeArray(arrayLikeObject: any): Array<any>

Parameters

  • arrayLikeObject: any

Returns

Array<any>

public moveCleanedNodesToContainerElement(nodes: Array<any>): HTMLElement

Parameters

  • nodes: Array<any>

Returns

HTMLElement

public parseHtmlFragment(html: string): Array<any>

Parameters

  • html: string

Returns

Array<any>

public parseJson(jsonString: string): any

Parameters

  • jsonString: string

Returns

any

public peekObservable(value: KnockoutObservable): T

Parameters

Returns

T

public postJson(urlOrForm: any, data: any, options: any)

Parameters

  • urlOrForm: any
  • data: any
  • options: any

public range(min: any, max: any): any

Parameters

  • min: any
  • max: any

Returns

any

public registerEventHandler(element: any, eventType: any, handler: Function)

Parameters

  • element: any
  • eventType: any
  • handler: Function

public replaceDomNodes(nodeToReplaceOrNodeArray: any, newNodesArray: Array<any>)

Parameters

  • nodeToReplaceOrNodeArray: any
  • newNodesArray: Array<any>

public setDomNodeChildren(domNode: any, childNodes: Array<any>)

Parameters

  • domNode: any
  • childNodes: Array<any>

public setElementName(element: any, name: string)

Parameters

  • element: any
  • name: string

public setHtml(node: Element, html: string)

Parameters

  • node: Element
  • html: string

public setHtml(node: Element, html: () => string)

Parameters

  • node: Element
  • html: () => string

public setOptionNodeSelectionState(optionNode: any, isSelected: boolean)

Parameters

  • optionNode: any
  • isSelected: boolean

public simpleHtmlParse(html: string): Array<any>

Parameters

  • html: string

Returns

Array<any>

public stringStartsWith(str: string, startsWith: string): string

Parameters

  • str: string
  • startsWith: string

Returns

string

public stringTokenize(str: string, delimiter: string): Array<string>

Parameters

  • str: string
  • delimiter: string

Returns

Array<string>

public stringTrim(str: string): string

Parameters

  • str: string

Returns

string

public stringifyJson(data: any, replacer?: Function, space?: string): string

Parameters

  • data: any
  • replacer?: Function optional
  • space?: string optional

Returns

string

public tagNameLower(element: any): string

Parameters

  • element: any

Returns

string

public toggleDomNodeCssClass(node: any, className: string, shouldHaveClass: boolean)

Parameters

  • node: any
  • className: string
  • shouldHaveClass: boolean

public triggerEvent(element: any, eventType: any)

Parameters

  • element: any
  • eventType: any

public unwrapObservable(value: KnockoutObservable): T

Parameters

Returns

T

public wrapAccessor(accessor: any): Function

Parameters

  • accessor: any

Returns

Function