import { HTML, HTMLBrand } from '../template/interface'; import { WatchOptions } from 'vue/types/options'; import * as Vue from 'vue'; export interface Emitter { (key: K, payload: T[K], ...args: any[]): void; } export declare type ScopedSlot = { [K in keyof T]: (scope: T[K]) => HTMLBrand; }; export interface HotModule { hot: { accept(): void; data?: { store: any; }; dispose(fn: Function): void; }; id: {}; } export interface Extends extends Mixin { extends(m: Comp): Mixin; } export interface Mixin extends Prop { mixin(m: Comp): Mixin; } export interface Prop extends Data { props(props: P1): Data> & P, D, C, M, K, E, S, T>; } export interface Data extends Declare { data(init: (this: P & D, p: P & D) => D1): Declare; } export interface Declare extends Repeatable { emit(): Declare; scopedSlots(): Declare; slots(): Declare; } export interface ComputedOpt { get?(this: V): T; set?(this: V, value: T): void; cache?: boolean; } export interface ComputedFunc { (this: V): T; } export declare type Computed = { [K in keyof C]: ComputedOpt; } & { [k: string]: ComputedOpt; }; export declare type ComputedFuncs = { [K in keyof C]: ComputedFunc; } & { [k: string]: ComputedFunc; }; export interface Methods { [k: string]: (this: V, ...args: any[]) => any; } export declare type Vueify = P & D & C & M & Special & Vue; export interface Repeatable extends Render { computed(opt: ComputedFuncs): Repeatable & C, M, K, E, S, T>; computed(opt: Computed): Repeatable; methods>>(opt: M1): Repeatable; } export interface Async { (): Promise | K; } export declare type Components = { [k in keyof K]: K[k] | Async; }; export declare type SlotComp = { slot: { props: ({ name: keyof S; } & S[keyof S]) | { name: keyof T; }; }; }; export declare type RenderComp = SlotComp & K; export interface RenderFunc { (this: Vueify, h: HTML>, vm: Vueify): HTMLBrand; } export interface Render extends Other { components(opt: Components): Render; render(f: RenderFunc): Other; } export interface WatchHandler { (this: V, val: T, oldVal: T): void; } export interface WatchOpt extends WatchOptions { handler: WatchHandler; } export declare type Watch = { [K in keyof T]?: WatchHandler | WatchOpt; }; export interface Lifecycle { beforeCreate?(this: V): void; created?(this: V): void; destroyed?(this: V): void; beforeMount?(this: V): void; mounted?(this: V): void; beforeUpdate?(this: V): void; updated?(this: V): void; activated?(this: V): void; deactivated?(this: V): void; } export interface Other { watch(opt: Watch

>): this; lifecycle(opt: Lifecycle>): this; done(module?: HotModule): Comp; } export interface Comp extends Special { props: P; data(): D; computed: C; methods: M; components: K; } export interface Special { $emit: Emitter; $scopedSlots: ScopedSlot; $slots: T; }