本文整理匯總了TypeScript中@aurelia/kernel.Reporter.write方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Reporter.write方法的具體用法?TypeScript Reporter.write怎麽用?TypeScript Reporter.write使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類@aurelia/kernel.Reporter
的用法示例。
在下文中一共展示了Reporter.write方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: validatePrototype
function validatePrototype(handler: IAttributePatternHandler, patternDefs: AttributePatternDefinition[]): void {
for (const def of patternDefs) {
// note: we're intentionally not throwing here
if (!(def.pattern in handler)) {
Reporter.write(401, def); // TODO: organize error codes
} else if (typeof handler[def.pattern] !== 'function') {
Reporter.write(402, def); // TODO: organize error codes
}
}
}
示例2: detaching
public detaching(flags: LifecycleFlags): void {
Reporter.write(10000, 'DETACHING viewport', this.name);
if (this.content.component) {
this.content.removeComponent(this.element, this.options.stateful);
}
this.enabled = false;
}
示例3: attaching
public attaching(flags: LifecycleFlags): void {
Reporter.write(10000, 'ATTACHING viewport', this.name, this.content, this.nextContent);
this.enabled = true;
if (this.content.component) {
this.content.addComponent(this.element);
}
}
示例4: createProperty
public createProperty(obj: IObservable, propertyName: string): DirtyCheckProperty {
if (DirtyCheckSettings.throw) {
throw Reporter.error(800); // TODO: create/organize error code
}
if (DirtyCheckSettings.warn) {
Reporter.write(801);
}
return new DirtyCheckProperty(this, obj, propertyName);
}
示例5: canLeave
public canLeave(nextInstruction: INavigationInstruction): Promise<boolean> {
if (!this.component || !this.component.canLeave) {
return Promise.resolve(true);
}
const result = this.component.canLeave(this.instruction, nextInstruction);
Reporter.write(10000, 'viewport canLeave', result);
if (typeof result === 'boolean') {
return Promise.resolve(result);
}
return result;
}
示例6: subscribe
function subscribe(this: PropertyObserver, subscriber: IPropertySubscriber): void {
if (this.observing === false) {
this.observing = true;
this.currentValue = this.obj[this.propertyKey];
if ((this.persistentFlags & LifecycleFlags.patchStrategy) === 0) {
observedPropertyDescriptor.get = () => this.getValue();
observedPropertyDescriptor.set = value => { this.setValue(value, LifecycleFlags.none); };
if (!defineProperty(this.obj, this.propertyKey, observedPropertyDescriptor)) {
Reporter.write(1, this.propertyKey, this.obj);
}
}
}
this.addSubscriber(subscriber);
}
示例7: enter
public async enter(): Promise<boolean> {
Reporter.write(10000, 'Viewport enter', this.name);
if (this.clear) {
return true;
}
if (!this.nextContent || !this.nextContent.component) {
return false;
}
await this.nextContent.enter(this.content.instruction);
await this.nextContent.loadComponent(this.context, this.element);
this.nextContent.initializeComponent();
return true;
}
示例8: canEnter
public canEnter(viewport: Viewport, previousInstruction: INavigationInstruction): Promise<boolean | ViewportInstruction[]> {
if (!this.component) {
return Promise.resolve(false);
}
if (!this.component.canEnter) {
return Promise.resolve(true);
}
const merged = mergeParameters(this.parameters, this.instruction.query, (this.content as IRouteableCustomElementType).parameters);
this.instruction.parameters = merged.namedParameters;
this.instruction.parameterList = merged.parameterList;
const result = this.component.canEnter(merged.merged, this.instruction, previousInstruction);
Reporter.write(10000, 'viewport canEnter', result);
if (typeof result === 'boolean') {
return Promise.resolve(result);
}
if (typeof result === 'string') {
return Promise.resolve([new ViewportInstruction(result, viewport)]);
}
return result as Promise<ViewportInstruction[]>;
}
示例9: loadContent
public async loadContent(): Promise<boolean> {
Reporter.write(10000, 'Viewport loadContent', this.name);
// No need to wait for next component activation
if (this.content.component && !this.nextContent.component) {
await this.content.leave(this.nextContent.instruction);
this.content.removeComponent(this.element, this.options.stateful);
this.content.terminateComponent(this.options.stateful);
this.content.unloadComponent();
this.content.destroyComponent();
}
if (this.nextContent.component) {
this.nextContent.addComponent(this.element);
// Only when next component activation is done
if (this.content.component) {
await this.content.leave(this.nextContent.instruction);
if (!this.content.reentry) {
this.content.removeComponent(this.element, this.options.stateful);
this.content.terminateComponent(this.options.stateful);
this.content.unloadComponent();
this.content.destroyComponent();
}
}
this.content = this.nextContent;
this.content.reentry = false;
}
if (this.clear) {
this.content = new ViewportContent(null, null, this.nextContent.instruction);
}
this.nextContent = null;
return true;
}