当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript Reporter.write方法代码示例

本文整理汇总了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
    }
  }
}
开发者ID:aurelia,项目名称:aurelia,代码行数:10,代码来源:attribute-pattern.ts

示例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;
 }
开发者ID:aurelia,项目名称:aurelia,代码行数:7,代码来源:viewport.ts

示例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);
   }
 }
开发者ID:aurelia,项目名称:aurelia,代码行数:7,代码来源:viewport.ts

示例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);
 }
开发者ID:aurelia,项目名称:aurelia,代码行数:9,代码来源:dirty-checker.ts

示例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;
  }
开发者ID:aurelia,项目名称:aurelia,代码行数:13,代码来源:viewport-content.ts

示例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);
}
开发者ID:aurelia,项目名称:aurelia,代码行数:14,代码来源:property-observer.ts

示例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;
  }
开发者ID:aurelia,项目名称:aurelia,代码行数:16,代码来源:viewport.ts

示例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[]>;
  }
开发者ID:aurelia,项目名称:aurelia,代码行数:22,代码来源:viewport-content.ts

示例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;
  }
开发者ID:aurelia,项目名称:aurelia,代码行数:38,代码来源:viewport.ts


注:本文中的@aurelia/kernel.Reporter.write方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。