mirror of
https://github.com/sorenisanerd/gotty.git
synced 2024-11-14 01:14:25 +00:00
Add typing for libapps
This commit is contained in:
parent
a8bb23f570
commit
2b4eb55d28
2
js/dist/gotty-bundle.js.map
vendored
2
js/dist/gotty-bundle.js.map
vendored
File diff suppressed because one or more lines are too long
4
js/dist/hterm.d.ts
vendored
4
js/dist/hterm.d.ts
vendored
@ -1,8 +1,8 @@
|
|||||||
import * as bare from "libapps";
|
import * as bare from "libapps";
|
||||||
export declare class Hterm {
|
export declare class Hterm {
|
||||||
elem: HTMLElement;
|
elem: HTMLElement;
|
||||||
term: bare.Terminal;
|
term: bare.hterm.Terminal;
|
||||||
io: bare.IO;
|
io: bare.hterm.IO;
|
||||||
columns: number;
|
columns: number;
|
||||||
rows: number;
|
rows: number;
|
||||||
message: string;
|
message: string;
|
||||||
|
@ -3,8 +3,8 @@ import * as bare from "libapps";
|
|||||||
export class Hterm {
|
export class Hterm {
|
||||||
elem: HTMLElement;
|
elem: HTMLElement;
|
||||||
|
|
||||||
term: bare.Terminal;
|
term: bare.hterm.Terminal;
|
||||||
io: bare.IO;
|
io: bare.hterm.IO;
|
||||||
|
|
||||||
columns: number;
|
columns: number;
|
||||||
rows: number;
|
rows: number;
|
||||||
|
53
js/typings/libapps/index.d.ts
vendored
Normal file
53
js/typings/libapps/index.d.ts
vendored
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
export namespace hterm {
|
||||||
|
export interface Terminal {
|
||||||
|
io: IO;
|
||||||
|
onTerminalReady: () => void;
|
||||||
|
|
||||||
|
getPrefs(): Prefs;
|
||||||
|
decorate(HTMLElement);
|
||||||
|
installKeyboard(): void;
|
||||||
|
uninstallKeyboard(): void;
|
||||||
|
setWindowTitle(title: string): void;
|
||||||
|
reset(): void;
|
||||||
|
softReset(): void;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface TerminalConstructor {
|
||||||
|
new (): Terminal;
|
||||||
|
(): Terminal;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export interface IO {
|
||||||
|
writeUTF8: ((data: string) => void);
|
||||||
|
writeUTF16: ((data: string) => void);
|
||||||
|
onVTKeystroke: ((data: string) => void) | null;
|
||||||
|
sendString: ((data: string) => void) | null;
|
||||||
|
onTerminalResize: ((columns: number, rows: number) => void) | null;
|
||||||
|
|
||||||
|
push(): IO;
|
||||||
|
writeUTF(data: string);
|
||||||
|
showOverlay(message: string, timeout: number | null);
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Prefs {
|
||||||
|
set(key: string, value: string): void;
|
||||||
|
}
|
||||||
|
|
||||||
|
export var Terminal: TerminalConstructor;
|
||||||
|
export var defaultStorage: lib.Storage;
|
||||||
|
}
|
||||||
|
|
||||||
|
export namespace lib {
|
||||||
|
export interface Storage {
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Memory {
|
||||||
|
new (): Storage;
|
||||||
|
Memory(): Storage
|
||||||
|
}
|
||||||
|
|
||||||
|
export var Storage: {
|
||||||
|
Memory: Memory
|
||||||
|
}
|
||||||
|
}
|
@ -209,7 +209,7 @@ func staticJsGottyBundleJs() (*asset, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
info := bindataFileInfo{name: "static/js/gotty-bundle.js", size: 773299, mode: os.FileMode(436), modTime: time.Unix(1503385387, 0)}
|
info := bindataFileInfo{name: "static/js/gotty-bundle.js", size: 773299, mode: os.FileMode(436), modTime: time.Unix(1503386172, 0)}
|
||||||
a := &asset{bytes: bytes, info: info}
|
a := &asset{bytes: bytes, info: info}
|
||||||
return a, nil
|
return a, nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user