omi v5.0.2 - fix omi.d.ts

This commit is contained in:
张磊 2018-11-26 11:30:19 +08:00
parent 4660e0fc4d
commit bbb29ace40
11 changed files with 24 additions and 16 deletions

View File

@ -2,6 +2,7 @@ export = Omi;
export as namespace Omi;
declare namespace Omi {
type Callback = (...args: any[]) => void;
type Key = string | number;
type Ref<T> = (instance: T) => void;
type ComponentChild = VNode<any> | object | string | number | boolean | null;
@ -109,6 +110,12 @@ declare namespace Omi {
abstract render(props: RenderableProps<P>, data: D): void;
}
// The class type (not instance of class)
// https://stackoverflow.com/q/42753968/2777142
interface WeElementConstructor {
new(): WeElement;
}
abstract class ModelView<P = {}, D = {}> {
constructor();
@ -164,10 +171,11 @@ declare namespace Omi {
function render(vnode: ComponentChild, parent: string | Element | Document | ShadowRoot | DocumentFragment, store?: object): void;
function define(name: string, ctor: any): void;
function tag(name: string, pure?: boolean): (ctor: any) => void;
function tick(callback: () => void, scope?: any): void;
function nextTick(callback: () => void, scope?: any): void;
function define(name: string, ctor: WeElementConstructor): void;
function tag(name: string, pure?: boolean): (ctor: WeElementConstructor) => void;
function tick(callback: Callback, scope?: any): void;
function nextTick(callback: Callback, scope?: any): void;
function observe(target: WeElementConstructor): void;
var options: {
vnode?: (vnode: VNode<any>) => void;

View File

@ -1,5 +1,5 @@
/**
* omi v5.0.1 http://omijs.org
* omi v5.0.2 http://omijs.org
* Omi === Preact + Scoped CSS + Store System + Native Support in 3kb javascript.
* By dntzhang https://github.com/dntzhang
* Github: https://github.com/Tencent/omi
@ -1509,7 +1509,7 @@
};
options.root.Omi = omi;
options.root.Omi.version = '5.0.1';
options.root.Omi.version = '5.0.2';
if (typeof module != 'undefined') module.exports = omi;else self.Omi = omi;
}());

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
/**
* omi v5.0.1 http://omijs.org
* omi v5.0.2 http://omijs.org
* Omi === Preact + Scoped CSS + Store System + Native Support in 3kb javascript.
* By dntzhang https://github.com/dntzhang
* Github: https://github.com/Tencent/omi
@ -1506,7 +1506,7 @@ var omi = {
};
options.root.Omi = omi;
options.root.Omi.version = '5.0.1';
options.root.Omi.version = '5.0.2';
export default omi;
export { tag, WeElement, Component, render, h, h as createElement, options, define, observe, cloneElement, getHost, rpx, tick, nextTick, ModelView };

File diff suppressed because one or more lines are too long

View File

@ -893,7 +893,7 @@
ModelView: ModelView
};
options.root.Omi = omi;
options.root.Omi.version = '5.0.1';
options.root.Omi.version = '5.0.2';
if ('undefined' != typeof module) module.exports = omi; else self.Omi = omi;
}();
//# sourceMappingURL=omi.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{
"name": "omi",
"version": "5.0.1",
"version": "5.0.2",
"description": "Next generation web framework.",
"main": "dist/omi.js",
"jsnext:main": "dist/omi.esm.js",

View File

@ -32,7 +32,7 @@ const omi = {
}
options.root.Omi = omi
options.root.Omi.version = '5.0.1'
options.root.Omi.version = '5.0.2'
export default omi