forked from choojs/choo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
38 lines (32 loc) · 820 Bytes
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/// <reference types="node" />
import * as EventEmitter from 'events'
export = Choo
declare class Choo {
constructor (opts?: Choo.IChoo)
use (callback: (state: Choo.IState, emitter: EventEmitter, app: this) => void): void
route (routeName: string, handler: (state: Choo.IState, emit: (name: string, ...args: any[]) => void) => void): void
mount (selector: string): void
start (): HTMLElement
toString (location: string, state?: Choo.IState): string
}
declare namespace Choo {
export interface IChoo {
history?: boolean
href?: boolean
}
export interface IState {
events: {
[key: string]: string
}
params: {
[key: string]: string
}
query?: {
[key: string]: string
}
href: string
route: string
title: string
[key: string]: any
}
}