@nakedobjects/cicero
Version:
Single Page Application client for a Naked Objects application.
76 lines (75 loc) • 4.67 kB
TypeScript
import { Location } from '@angular/common';
import * as Ro from '@nakedobjects/restful-objects';
import { ConfigService, ContextService, ErrorService, MaskService, PaneRouteData, UrlManagerService } from '@nakedobjects/services';
import { Dictionary } from 'lodash';
import * as Commandresult from './command-result';
import { CommandResult } from './command-result';
import { CiceroCommandFactoryService } from '../cicero-command-factory.service';
import { CiceroContextService } from '../cicero-context.service';
import { CiceroRendererService } from '../cicero-renderer.service';
export declare abstract class Command {
protected urlManager: UrlManagerService;
protected location: Location;
protected commandFactory: CiceroCommandFactoryService;
protected context: ContextService;
protected mask: MaskService;
protected error: ErrorService;
protected configService: ConfigService;
protected ciceroContext: CiceroContextService;
protected ciceroRenderer: CiceroRendererService;
constructor(urlManager: UrlManagerService, location: Location, commandFactory: CiceroCommandFactoryService, context: ContextService, mask: MaskService, error: ErrorService, configService: ConfigService, ciceroContext: CiceroContextService, ciceroRenderer: CiceroRendererService);
argString: string | null;
chained: boolean;
abstract shortCommand: string;
abstract fullCommand: string;
abstract helpText: string;
protected abstract minArguments: number;
protected abstract maxArguments: number;
protected get keySeparator(): string;
execute(): Promise<CommandResult>;
protected returnResult(input: string | null, output: string | null, changeState?: () => void, stopChain?: boolean): Promise<CommandResult>;
protected abstract doExecute(args: string | null, chained: boolean, result: CommandResult): Promise<CommandResult>;
abstract isAvailableInCurrentContext(): boolean;
protected mayNotBeChained(rider?: string): string;
checkMatch(matchText: string): void;
protected argumentAsString(argString: string | null, argNo: number, optional?: boolean, toLower?: boolean): string | undefined;
protected argumentAsNumber(args: string | null, argNo: number, optional?: boolean): number | null;
protected parseInt(input: string): number;
protected parseRange(arg?: string): {
start: number | null;
end: number | null;
};
protected getContextDescription(): string | null;
protected routeData(): PaneRouteData;
protected isHome(): boolean;
protected isObject(): boolean;
protected getObject(): Promise<Ro.DomainObjectRepresentation>;
protected isList(): boolean;
protected getList(): Promise<Ro.ListRepresentation>;
protected isMenu(): boolean;
protected getMenu(): Promise<Ro.MenuRepresentation>;
protected isDialog(): boolean;
protected isMultiChoiceField(field: Ro.IField): boolean;
protected getActionForCurrentDialog(): Promise<Ro.InvokableActionMember | Ro.ActionRepresentation>;
protected isCollection(): boolean;
protected closeAnyOpenCollections(): void;
protected isTable(): boolean;
protected isEdit(): boolean;
protected isForm(): boolean;
protected isTransient(): boolean;
protected matchingProperties(obj: Ro.DomainObjectRepresentation, match?: string): Ro.PropertyMember[];
protected matchingCollections(obj: Ro.DomainObjectRepresentation, match?: string): Ro.CollectionMember[];
protected matchingParameters(action: Ro.InvokableActionMember, match: string): Ro.Parameter[];
protected matchFriendlyNameAndOrMenuPath<T extends Ro.IHasExtensions>(reps: T[], match: string | undefined): T[];
protected findMatchingChoicesForRef(choices: Dictionary<Ro.Value> | null, titleMatch: string): Ro.Value[];
protected findMatchingChoicesForScalar(choices: Dictionary<Ro.Value> | null, titleMatch: string): Ro.Value[];
protected handleErrorResponse(err: Ro.ErrorMap, getFriendlyName: (id: string) => string): Promise<Commandresult.CommandResult>;
protected handleErrorResponseNew(err: Ro.ErrorMap, getFriendlyName: (id: string) => string): Promise<Commandresult.CommandResult>;
protected validationMessage(reason: string | null, value: Ro.Value, fieldFriendlyName: string): string;
private fieldValidationMessage;
protected valueForUrl(val: Ro.Value, field: Ro.IField): Ro.Value | null;
private leanLink;
private addOrRemoveValue;
protected setFieldValueInContext(field: Ro.Parameter, val: Ro.Value): void;
protected setPropertyValueinContext(obj: Ro.DomainObjectRepresentation, property: Ro.PropertyMember, urlVal: Ro.Value): void;
}