UNPKG

1.39 kBTypeScriptView Raw
1import * as Token from './token'
2export interface IMachine {
3 login?: string
4 password?: string
5 account?: string
6}
7export interface Options {
8 pre?: string
9 post?: string
10 elements?: Element[]
11}
12export declare class Prop extends Token {
13 type: string
14 name: Token.MachineProps
15 value: string
16 constructor(
17 opts: Options & {
18 name: Token.MachineProps
19 value: string
20 },
21 )
22 protected readonly _content: string
23}
24export interface MachineOptions extends Options {
25 login?: string
26 password?: string
27 account?: string
28}
29export abstract class MachineBase extends Token {
30 protected tokens: (Prop | Comment)[]
31 constructor({ login, password, account, ...opts }?: MachineOptions)
32 login: string | undefined
33 password: string | undefined
34 account: string | undefined
35 addProp(prop: Prop): void
36 private getProp(name)
37 private setProp(name, value)
38}
39export declare class Machine extends MachineBase implements Token.Machine {
40 type: 'machine'
41 host: string
42 constructor({
43 host,
44 ...opts
45 }: MachineOptions & {
46 host: string
47 })
48 protected readonly _content: string
49}
50export declare class DefaultMachine extends MachineBase implements Token.Default {
51 type: 'default'
52 protected readonly _content: string
53}
54export interface Machines {
55 [host: string]: IMachine
56}
57export declare function machinesProxy(tokens?: Token.Token[]): Machines
58
\No newline at end of file