@types/virtual-dom
Advanced tools
Comparing version 2.1.1 to 2.1.2
@@ -7,12 +7,12 @@ // Type definitions for virtual-dom 2.1.1 | ||
declare namespace VirtualDOM { | ||
interface VHook { | ||
hook(node: Element, propertyName: string): void; | ||
unhook(node: Element, propertyName: string): void; | ||
} | ||
interface VHook { | ||
hook(node: Element, propertyName: string): void; | ||
unhook(node: Element, propertyName: string): void; | ||
} | ||
type EventHandler = (...args: any[]) => void; | ||
type EventHandler = (...args: any[]) => void; | ||
interface VProperties { | ||
attributes?: {[index: string]: string} | undefined; | ||
/** | ||
interface VProperties { | ||
attributes?: { [index: string]: string } | undefined; | ||
/** | ||
I would like to use {[index: string]: string}, but then we couldn't use an | ||
@@ -23,155 +23,160 @@ object literal when setting the styles, since TypeScript doesn't seem to | ||
*/ | ||
style?: any; | ||
/** | ||
style?: any; | ||
/** | ||
The relaxation on `style` above is the reason why we need `any` as an option | ||
on the indexer type. | ||
*/ | ||
[index: string]: any | string | boolean | number | VHook | EventHandler | {[index: string]: string | boolean | number}; | ||
} | ||
[index: string]: any | string | boolean | number | VHook | EventHandler | { | ||
[index: string]: string | boolean | number; | ||
}; | ||
} | ||
interface VNode { | ||
tagName: string; | ||
properties: VProperties; | ||
children: VTree[]; | ||
key?: string | undefined; | ||
namespace?: string | undefined; | ||
count: number; | ||
hasWidgets: boolean; | ||
hasThunks: boolean; | ||
hooks: any[]; | ||
descendantHooks: any[]; | ||
version: string; | ||
type: string; // 'VirtualNode' | ||
} | ||
interface VNode { | ||
tagName: string; | ||
properties: VProperties; | ||
children: VTree[]; | ||
key?: string | undefined; | ||
namespace?: string | undefined; | ||
count: number; | ||
hasWidgets: boolean; | ||
hasThunks: boolean; | ||
hooks: any[]; | ||
descendantHooks: any[]; | ||
version: string; | ||
type: string; // 'VirtualNode' | ||
} | ||
interface VNodeConstructor { | ||
new (tagName: string, properties: VProperties, children: VTree[], key?: string, namespace?: string): VNode; | ||
} | ||
interface VNodeConstructor { | ||
new(tagName: string, properties: VProperties, children: VTree[], key?: string, namespace?: string): VNode; | ||
} | ||
interface VText { | ||
text: string; | ||
version: string; | ||
type: string; // 'VirtualText' | ||
} | ||
interface VText { | ||
text: string; | ||
version: string; | ||
type: string; // 'VirtualText' | ||
} | ||
interface VTextConstructor { | ||
new (text: string): VText; | ||
} | ||
interface VTextConstructor { | ||
new(text: string): VText; | ||
} | ||
interface Widget { | ||
type: string; // 'Widget' | ||
init(): Element; | ||
update(previous: Widget, domNode: Element): void; | ||
destroy(node: Element): void; | ||
} | ||
interface Widget { | ||
type: string; // 'Widget' | ||
init(): Element; | ||
update(previous: Widget, domNode: Element): void; | ||
destroy(node: Element): void; | ||
} | ||
interface Thunk { | ||
type: string; // 'Thunk' | ||
vnode: VTree; | ||
render(previous: VTree): VTree; | ||
} | ||
interface Thunk { | ||
type: string; // 'Thunk' | ||
vnode: VTree; | ||
render(previous: VTree): VTree; | ||
} | ||
type VTree = VText | VNode | Widget | Thunk; | ||
type VTree = VText | VNode | Widget | Thunk; | ||
// enum VPatch { | ||
// NONE = 0, | ||
// VTEXT = 1, | ||
// VNODE = 2, | ||
// WIDGET = 3, | ||
// PROPS = 4, | ||
// ORDER = 5, | ||
// INSERT = 6, | ||
// REMOVE = 7, | ||
// THUNK = 8 | ||
// } | ||
interface VPatch { | ||
vNode: VNode; | ||
patch: any; | ||
version: string; | ||
/** | ||
// enum VPatch { | ||
// NONE = 0, | ||
// VTEXT = 1, | ||
// VNODE = 2, | ||
// WIDGET = 3, | ||
// PROPS = 4, | ||
// ORDER = 5, | ||
// INSERT = 6, | ||
// REMOVE = 7, | ||
// THUNK = 8 | ||
// } | ||
interface VPatch { | ||
vNode: VNode; | ||
patch: any; | ||
version: string; | ||
/** | ||
type is set to 'VirtualPatch' on the prototype, but overridden in the | ||
constructor with a number. | ||
*/ | ||
type: number; | ||
} | ||
type: number; | ||
} | ||
type PatchFn<T extends Element> = (rootNode: T, patches: VPatch[], renderOptions: VPatchOptions<T>) => T; | ||
type PatchFn<T extends Element> = (rootNode: T, patches: VPatch[], renderOptions: VPatchOptions<T>) => T; | ||
interface VPatchOptions<T extends Element> { | ||
patch?: PatchFn<T> | undefined; | ||
} | ||
interface VPatchOptions<T extends Element> { | ||
patch?: PatchFn<T> | undefined; | ||
} | ||
interface createProperties extends VProperties { | ||
key?: string | undefined; | ||
namespace?: string | undefined; | ||
} | ||
interface createProperties extends VProperties { | ||
key?: string | undefined; | ||
namespace?: string | undefined; | ||
} | ||
type VChild = VTree[] | VTree | string[] | string; | ||
type VChild = VTree[] | VTree | string[] | string; | ||
/** | ||
/** | ||
create() calls either document.createElement() or document.createElementNS(), | ||
for which the common denominator is Element (not HTMLElement). | ||
*/ | ||
function create(vnode: VText, opts?: {document?: Document | undefined; warn?: boolean | undefined}): Text; | ||
function create(vnode: VNode | Widget | Thunk, opts?: {document?: Document | undefined; warn?: boolean | undefined}): Element; | ||
function h(tagName: string, properties: createProperties, children: string | VChild[]): VNode; | ||
function h(tagName: string, children: string | VChild[]): VNode; | ||
function diff(left: VTree, right: VTree): VPatch[]; | ||
/** | ||
function create(vnode: VText, opts?: { document?: Document | undefined; warn?: boolean | undefined }): Text; | ||
function create( | ||
vnode: VNode | Widget | Thunk, | ||
opts?: { document?: Document | undefined; warn?: boolean | undefined }, | ||
): Element; | ||
function h(tagName: string, properties: createProperties, children: string | VChild[]): VNode; | ||
function h(tagName: string, children: string | VChild[]): VNode; | ||
function diff(left: VTree, right: VTree): VPatch[]; | ||
/** | ||
patch() usually just returns rootNode after doing stuff to it, so we want | ||
to preserve that type (though it will usually be just Element). | ||
*/ | ||
function patch<T extends Element>(rootNode: T, patches: VPatch[], renderOptions?: VPatchOptions<T>): T; | ||
function patch<T extends Element>(rootNode: T, patches: VPatch[], renderOptions?: VPatchOptions<T>): T; | ||
function isVNode(vTree: VTree): vTree is VNode; | ||
function isVText(vTree: VTree): vTree is VText; | ||
function isWidget(vTree: VTree): vTree is Widget; | ||
function isThunk(vTree: VTree): vTree is Thunk; | ||
function isVNode(vTree: VTree): vTree is VNode; | ||
function isVText(vTree: VTree): vTree is VText; | ||
function isWidget(vTree: VTree): vTree is Widget; | ||
function isThunk(vTree: VTree): vTree is Thunk; | ||
} | ||
declare module "virtual-dom/h" { | ||
// export = VirtualDOM.h; works just fine, but the DT checker doesn't like it | ||
import h = VirtualDOM.h; | ||
export = h; | ||
// export = VirtualDOM.h; works just fine, but the DT checker doesn't like it | ||
import h = VirtualDOM.h; | ||
export = h; | ||
} | ||
declare module "virtual-dom/create-element" { | ||
import create = VirtualDOM.create; | ||
export = create; | ||
import create = VirtualDOM.create; | ||
export = create; | ||
} | ||
declare module "virtual-dom/diff" { | ||
import diff = VirtualDOM.diff; | ||
export = diff; | ||
import diff = VirtualDOM.diff; | ||
export = diff; | ||
} | ||
declare module "virtual-dom/patch" { | ||
import patch = VirtualDOM.patch; | ||
export = patch; | ||
import patch = VirtualDOM.patch; | ||
export = patch; | ||
} | ||
declare module "virtual-dom" { | ||
export = VirtualDOM; | ||
export = VirtualDOM; | ||
} | ||
declare module "virtual-dom/vnode/vnode" { | ||
import VNodeConstructor = VirtualDOM.VNodeConstructor; | ||
const VNode: VNodeConstructor; | ||
export = VNode; | ||
import VNodeConstructor = VirtualDOM.VNodeConstructor; | ||
const VNode: VNodeConstructor; | ||
export = VNode; | ||
} | ||
declare module "virtual-dom/vnode/vtext" { | ||
import VTextConstructor = VirtualDOM.VTextConstructor; | ||
const VText: VTextConstructor; | ||
export = VText; | ||
import VTextConstructor = VirtualDOM.VTextConstructor; | ||
const VText: VTextConstructor; | ||
export = VText; | ||
} | ||
declare module "virtual-dom/vnode/is-vnode" { | ||
import isVNode = VirtualDOM.isVNode; | ||
export = isVNode; | ||
import isVNode = VirtualDOM.isVNode; | ||
export = isVNode; | ||
} | ||
declare module "virtual-dom/vnode/is-vtext" { | ||
import isVText = VirtualDOM.isVText; | ||
export = isVText; | ||
import isVText = VirtualDOM.isVText; | ||
export = isVText; | ||
} | ||
declare module "virtual-dom/vnode/is-widget" { | ||
import isWidget = VirtualDOM.isWidget; | ||
export = isWidget; | ||
import isWidget = VirtualDOM.isWidget; | ||
export = isWidget; | ||
} | ||
declare module "virtual-dom/vnode/is-thunk" { | ||
import isThunk = VirtualDOM.isThunk; | ||
export = isThunk; | ||
import isThunk = VirtualDOM.isThunk; | ||
export = isThunk; | ||
} |
{ | ||
"name": "@types/virtual-dom", | ||
"version": "2.1.1", | ||
"version": "2.1.2", | ||
"description": "TypeScript definitions for virtual-dom", | ||
@@ -23,4 +23,4 @@ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/virtual-dom", | ||
"dependencies": {}, | ||
"typesPublisherContentHash": "fae5763678d22bd117dad04991e429f0eb4a9403a5d25929e59809fe540d51de", | ||
"typeScriptVersion": "3.6" | ||
"typesPublisherContentHash": "dbcdb00dc103bd10340ed4c9b23bdf780369bd21f9f91fc936db465f4e6d356e", | ||
"typeScriptVersion": "4.5" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
### Additional Details | ||
* Last updated: Fri, 02 Jul 2021 18:05:06 GMT | ||
* Last updated: Tue, 26 Sep 2023 10:06:28 GMT | ||
* Dependencies: none | ||
@@ -14,0 +14,0 @@ * Global values: `VirtualDOM` |
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
7973
162