本文整理汇总了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;
}