[adone] refactoring (#25461)

* application -> app
This commit is contained in:
am
2018-05-03 18:09:26 +02:00
committed by Andy
parent eaf81825ef
commit d6da19d371
5 changed files with 28 additions and 30 deletions

View File

@@ -1,5 +1,5 @@
declare namespace adone {
namespace application {
namespace app {
namespace I {
type ArgumentType = ((x: string, index: number) => any) | RegExp;
@@ -12,7 +12,7 @@ declare namespace adone {
| "append"
| "count"
| "set";
nargs?: number | "+" | "*" | "?"
nargs?: number | "+" | "*" | "?";
type?: ArgumentType | ArgumentType[];
verify?: (args: any, opts: any) => boolean; // TODO
required?: boolean;
@@ -49,7 +49,7 @@ declare namespace adone {
name?: string;
description?: string;
subsystems?: SubsystemInfo[];
commandsGroups?: Group[]
commandsGroups?: Group[];
}
interface SubsystemInfo {
@@ -71,24 +71,24 @@ declare namespace adone {
namespace I {
interface LoadSubsystemOptions {
name?: string,
description?: string,
group?: string,
transpile?: boolean
name?: string;
description?: string;
group?: string;
transpile?: boolean;
}
interface CommonAddSubsystemInfo {
name?: string,
useFilename?: boolean
description?: string,
group?: string,
configureArgs?: any[]
transpile?: boolean,
bind?: boolean | string
name?: string;
useFilename?: boolean;
description?: string;
group?: string;
configureArgs?: any[];
transpile?: boolean;
bind?: boolean | string;
}
interface AddSubsystemInfo extends CommonAddSubsystemInfo {
subsystem: Subsystem | string,
subsystem: Subsystem | string;
}
interface SysInfo {
@@ -109,7 +109,7 @@ declare namespace adone {
}
interface AddSubsystemsFromOptions extends CommonAddSubsystemInfo {
filter?: string[] | ((file: string) => boolean | Promise<boolean>)
filter?: string[] | ((file: string) => boolean | Promise<boolean>);
}
}
@@ -211,25 +211,22 @@ declare namespace adone {
_rejectionHandled(p: Promise<any>): void;
_signalExit(sigName: string): void;
}
namespace I {
interface Command {
// ?
names: string[];
// TODO
}
interface Argument {
// ?
names: string[];
// TODO
}
interface PositionalArgument extends Argument {
// ?
}
type PositionalArgument = Argument; // TODO
interface OptionalArgument extends Argument {
// ?
}
type OptionalArgument = Argument; // TODO
interface DefineCommandFromSubsystemOptions {
name?: string;

View File

@@ -320,12 +320,12 @@ declare namespace adone {
/**
* Checks whether the given object is an adone subsystem
*/
export function subsystem(obj: any): obj is adone.application.Subsystem;
export function subsystem(obj: any): obj is adone.app.Subsystem;
/**
* Checks whether the given object is an adone application
*/
export function application(obj: any): obj is adone.application.Application;
export function application(obj: any): obj is adone.app.Application;
/**
* Checks whether the given object is an adone logger

View File

@@ -5,7 +5,7 @@
// TypeScript Version: 2.4
/// <reference path="./adone.d.ts" />
/// <reference path="./glosses/application.d.ts" />
/// <reference path="./glosses/app.d.ts" />
/// <reference path="./glosses/archives.d.ts" />
/// <reference path="./glosses/assertion.d.ts" />
/// <reference path="./glosses/collections/index.d.ts" />

View File

@@ -8,7 +8,7 @@ namespace applicationTests {
Subsystem,
runCli,
Application
} = adone.application;
} = adone.app;
namespace DApplicationTests {
{

View File

@@ -24,6 +24,7 @@
"adone.d.ts",
"async.d.ts",
"benchmark.d.ts",
"glosses/app.d.ts",
"glosses/archives.d.ts",
"glosses/assertion.d.ts",
"glosses/collections/array_set.d.ts",
@@ -95,7 +96,7 @@
"glosses/utils.d.ts",
"glosses/vault.d.ts",
"index.d.ts",
"test/glosses/application.ts",
"test/glosses/app.ts",
"test/glosses/archives.ts",
"test/glosses/assertion.ts",
"test/glosses/collections/array_set.ts",