omip - fix ts template error

This commit is contained in:
dntzhang 2019-03-03 07:43:14 +08:00
parent b73feca7ac
commit 3cc87db793
3 changed files with 8 additions and 4 deletions

View File

@ -4,8 +4,12 @@ import '../my-element'
import './index.css'
interface IData {
count: number
}
define('my-counter', class extends WeElement {
data = {
data: IData = {
count: 1
}

View File

@ -53,7 +53,7 @@ declare namespace Omi {
}
type RenderableProps<P, RefType = any> = Readonly<
P & Attributes & { children?: ComponentChildren; ref?: Ref<RefType> }
P & Attributes & { children?: ComponentChildren; ref?: Ref<RefType> } & any
>;
interface WeElement<P, D> extends App.AppInstance {
@ -103,8 +103,8 @@ declare namespace Omi {
data: D;
host: HTMLElement;
update(): void;
fire(name: string, data?: object): void;
update(patch?: object, callback?: () => void): void;
fire(name: string, data?: any): void;
// Abstract methods don't infer argument types
// https://github.com/Microsoft/TypeScript/issues/14887