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


TypeScript white.bold方法代码示例

本文整理汇总了TypeScript中chalk.white.bold方法的典型用法代码示例。如果您正苦于以下问题:TypeScript white.bold方法的具体用法?TypeScript white.bold怎么用?TypeScript white.bold使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在chalk.white的用法示例。


在下文中一共展示了white.bold方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1:

 this.project.documents.entries.forEach((document: Document) => {
   console.log(
     '  ',
     chalk.gray('Format:'),
     chalk.white.bold(document.format)
   )
   console.log('  ', chalk.gray('Path:'), chalk.white.bold(document.path))
   console.log('')
 })
开发者ID:mirego,项目名称:accent-cli,代码行数:9,代码来源:project-stats.ts

示例2: log

export function log( type: 'title' | 'success' | 'error' | 'step' | 'substep' | 'default' = 'default', message: string = '' ): void {

	switch( type ) {

		case 'title':
			console.log( chalk.white.bold.underline( message ) );
			break;

		case 'success':
			console.log( chalk.green.bold( message ) );
			break;

		case 'error':
			console.log( chalk.red.bold( message ) );
			break;

		case 'step':
			console.log( chalk.white.bold( `  ${  message }` ) );
			break;

		case 'substep':
			console.log( chalk.gray( `    ${ arrowSymbol } ${  message }` ) );
			break;

		default:
			console.log( message );

	}

}
开发者ID:dominique-mueller,项目名称:automatic-release,代码行数:30,代码来源:log.ts

示例3: getCallbackId

  const sendRequest = <DataT extends object | undefined>(
    method: string, path: string, data?: DataT, authenticating: boolean = false
  ) => {
    // Pre-checks
    if (!authenticating && !socket().isConnected()) {
      logger.warn(`Attempting to send request on a non-authenticated socket: ${path}`);
      return Promise.reject('Not authorized');
    }

    if (!socket().nativeSocket) {
      logger.warn(`Attempting to send request without a socket: ${path}`);
      return Promise.reject('No socket');
    }

    const callbackId = getCallbackId();

    // Reporting
    invariant(path, 'Attempting socket request without a path');

    const ignored = eventIgnored(path, ignoredRequestPaths);
    if (!ignored) {
      logger.verbose(
        chalk.white.bold(callbackId.toString()), 
        method, 
        path, 
        data ? filterPassword(data) : '(no data)'
      );
    }

    // Callback
    const resolver = Promise.pending();

    callbacks[callbackId] = {
      time: new Date().getTime(),
      resolver,
      ignored,
    };

    // Actual request
    const request = {
      path,
      method,
      data,
      callback_id: callbackId,
    } as APIInternal.OutgoingRequest;

    socket().nativeSocket!.send(JSON.stringify(request));
    return resolver.promise;
  };
开发者ID:airdcpp-web,项目名称:airdcpp-apisocket-js,代码行数:49,代码来源:SocketRequestHandler.ts

示例4: echoStatus

	public echoStatus(prefix: string, statusText: string) {
		console.log(chalk.white.bold(prefix), chalk.green(statusText));
	}
开发者ID:duffman,项目名称:superbob,代码行数:3,代码来源:terminal.ts

示例5:

 matches.forEach(function (match) {
     const extracted = match.replace(/(^\*)|(\*$)/g, '')
     text = text.replace(match, '' + chalk.white.bold(extracted))
 })
开发者ID:brynbellomy,项目名称:cli-components-io,代码行数:4,代码来源:index.ts

示例6: log

  public log() {
    const translationsCount = this.project.revisions.reduce(
      (memo, revision: Revision) => memo + revision.translationsCount,
      0
    )
    const conflictsCount = this.project.revisions.reduce(
      (memo, revision: Revision) => memo + revision.conflictsCount,
      0
    )
    const reviewedCount = this.project.revisions.reduce(
      (memo, revision: Revision) => memo + revision.reviewedCount,
      0
    )

    console.log(chalk.magenta('Last synced'))
    console.log('  ', chalk.white.bold(this.project.lastSyncedAt))

    console.log('')

    console.log(chalk.magenta('Master language'))
    console.log(
      '  ',
      chalk.white.bold(this.project.language.name) +
        ' – ' +
        this.project.language.slug
    )

    console.log('')

    if (this.project.revisions.length > 1) {
      console.log(
        chalk.magenta(`Translations (${this.project.revisions.length - 1})`)
      )
      this.project.revisions.forEach((revision: Revision) => {
        if (this.project.language.id !== revision.language.id) {
          console.log(
            '  ',
            chalk.white.bold(revision.language.name) +
              ' – ' +
              revision.language.slug
          )
          console.log('')
        }
      })
    }

    console.log(chalk.magenta('Documents'))
    this.project.documents.entries.forEach((document: Document) => {
      console.log(
        '  ',
        chalk.gray('Format:'),
        chalk.white.bold(document.format)
      )
      console.log('  ', chalk.gray('Path:'), chalk.white.bold(document.path))
      console.log('')
    })

    console.log(chalk.magenta('Strings'))
    console.log(
      '  ',
      chalk.white('# Strings:'),
      chalk.white(`${translationsCount}`)
    )
    console.log(
      '  ',
      chalk.green('✓ Reviewed:'),
      chalk.green(`${reviewedCount}`)
    )
    console.log('  ', chalk.red('× In review:'), chalk.red(`${conflictsCount}`))
  }
开发者ID:mirego,项目名称:accent-cli,代码行数:70,代码来源:project-stats.ts


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