From 46a8b006f0f28cec31e2c41d3cbae4c49fdcc5dc Mon Sep 17 00:00:00 2001 From: Iwasaki Yudai Date: Wed, 23 Aug 2017 10:56:34 +0900 Subject: [PATCH] Fix typing of hterm --- js/typings/libapps/index.d.ts | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/js/typings/libapps/index.d.ts b/js/typings/libapps/index.d.ts index 053ff4d..7d3888a 100644 --- a/js/typings/libapps/index.d.ts +++ b/js/typings/libapps/index.d.ts @@ -1,8 +1,9 @@ -export namespace hterm { - export interface Terminal { +export declare namespace hterm { + export class Terminal { io: IO; onTerminalReady: () => void; + constructor(); getPrefs(): Prefs; decorate(HTMLElement); installKeyboard(): void; @@ -12,13 +13,7 @@ export namespace hterm { softReset(): void; } - export interface TerminalConstructor { - new (): Terminal; - (): Terminal; - } - - - export interface IO { + export class IO { writeUTF8: ((data: string) => void); writeUTF16: ((data: string) => void); onVTKeystroke: ((data: string) => void) | null; @@ -30,15 +25,14 @@ export namespace hterm { showOverlay(message: string, timeout: number | null); } - export interface Prefs { + export class Prefs { set(key: string, value: string): void; } - export var Terminal: TerminalConstructor; export var defaultStorage: lib.Storage; } -export namespace lib { +export declare namespace lib { export interface Storage { }