• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript signaling.defineSignal函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了TypeScript中phosphor/lib/core/signaling.defineSignal函数的典型用法代码示例。如果您正苦于以下问题:TypeScript defineSignal函数的具体用法?TypeScript defineSignal怎么用?TypeScript defineSignal使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: onAfterAttach

   */
  protected onAfterAttach(msg: Message): void {
    this.selectNode.addEventListener('change', this);
  }

  /**
   * Handle `before-detach` messages for the widget.
   */
  protected onBeforeDetach(msg: Message): void {
    this.selectNode.removeEventListener('change', this);
  }
}


// Define the signals for the `CSVToolbar` class.
defineSignal(CSVToolbar.prototype, 'delimiterChanged');


/**
 * A namespace for `CSVToolbar` statics.
 */
export
namespace CSVToolbar {
  /**
   * The instantiation options for a CSV toolbar.
   */
  export
  interface IOptions {
    /**
     * The initially selected delimiter.
     */
开发者ID:danielballan,项目名称:jupyterlab,代码行数:31,代码来源:toolbar.ts


示例2: defineSignal

  _collapsed: boolean;
  _content: Panel;
  _widget: Widget;
  _header: Widget;
}

export
namespace Collapse {
  export
  interface IOptions extends Widget.IOptions {
    widget: Widget;
  }
}

// Define the signals for the `Widget` class.
defineSignal(Collapse.prototype, 'collapseChanged');


/**
 * The class name added to Accordion instances.
 */
const ACCORDION_CLASS = 'p-Accordion';

/**
 * The class name added to an Accordion child.
 */
const ACCORDION_CHILD_CLASS = 'p-Accordion-child';

const ACCORDION_CHILD_ACTIVE_CLASS = 'p-Accordion-child-active';

/**
开发者ID:cameronoelsen,项目名称:ipywidgets,代码行数:31,代码来源:accordion.ts


示例3: defineSignal

} from 'phosphor/lib/core/signaling';

import {
  ActivityMonitor
} from '../../../lib/common/activitymonitor';



class TestObject {
  one: ISignal<TestObject, number>;

  two: ISignal<TestObject, string[]>;
}


defineSignal(TestObject.prototype, 'one');
defineSignal(TestObject.prototype, 'two');



describe('common/activitymonitor', () => {

  describe('ActivityMonitor()', () => {

    let testObj: TestObject;
    let signal: ISignal<TestObject, number>;

    beforeEach(() => {
      testObj = new TestObject();
      signal = testObj.one;
    });
开发者ID:Carreau,项目名称:jupyterlab,代码行数:31,代码来源:activitymonitor.spec.ts


示例4: onChildAdded

   */
  protected onChildAdded(msg: ChildMessage): void {
    msg.child.addClass(CHILD_CLASS);
  }

  /**
   * A message handler invoked on a `'child-removed'` message.
   */
  protected onChildRemoved(msg: ChildMessage): void {
    msg.child.removeClass(CHILD_CLASS);
    this.widgetRemoved.emit(msg.child);
  }
}

// Define the signals for the `EventedPanel` class.
defineSignal(EventedPanel.prototype, 'widgetRemoved');



/**
 * A widget which combines a `TabBar` and a `EventedPanel`.
 *
 * #### Notes
 * This is a simple panel which handles the common case of a tab bar
 * placed next to a content area. The selected tab controls the widget
 * which is shown in the content area.
 *
 * For use cases which require more control than is provided by this
 * panel, the `TabBar` widget may be used independently.
 * 
 * TODO: Support setting the direction??
开发者ID:cameronoelsen,项目名称:ipywidgets,代码行数:31,代码来源:tabpanel.ts


示例5: defineSignal

    // A completion request signal should only be emitted if the current
    // character or a preceding character is not whitespace.
    //
    // Otherwise, the default tab action of creating a tab character should be
    // allowed to propagate.
    if (!currentLine.substring(0, ch).match(/\S/)) {
      return;
    }

    event.preventDefault();
    event.stopPropagation();
    event.stopImmediatePropagation();

    const chHeight = editor.defaultTextHeight();
    const chWidth = editor.defaultCharWidth();
    const coords = editor.charCoords({ line, ch }, 'page') as ICoords;
    const position = editor.getDoc().indexFromPos({ line, ch });
    let data = {
      line, ch, chHeight, chWidth, coords, position, currentValue
    };
    this.completionRequested.emit(data as ICompletionRequest);
  }

}

// Define the signals for the `CompletableCodeMirrorCellEditorWidget` class.
defineSignal(CodeMirrorCellEditorWidget.prototype, 'textChanged');
defineSignal(CodeMirrorCellEditorWidget.prototype, 'completionRequested');

开发者ID:TypeFox,项目名称:jupyterlab,代码行数:28,代码来源:editor.ts


示例6: defineSignal

    let maximum = DISPLAY_LIMIT;
    if (available > maximum) {
      // Mutate the array instead of slicing in order to conserve memory.
      output.splice(maximum);
      this.maxExceeded.emit({ available, maximum });
    }
    return output;
  }

  private _content: string;
  private _delimiter: string;
}


// Define the signals for the `CSVModel` class.
defineSignal(CSVModel.prototype, 'maxExceeded');


/**
 * A namespace for `CSVModel` statics.
 */
export
namespace CSVModel {
  /**
   * The value emitted when there are more data rows than what can be displayed.
   */
  export
  interface IOverflow {
    /**
     * The actual number of rows in the data.
     */
开发者ID:danielballan,项目名称:jupyterlab,代码行数:31,代码来源:table.ts


示例7: setValue

    if (this.presenter) {
      this.presenter.dispose();
      this.presenter = null
    }
  }

  setValue(value: string) {
    super.setValue(value);
    this.editor.getDoc().clearHistory();
  }

  /**
   * Handle keydown events from the editor.
   */
  protected onEditorKeydown(editor: CodeMirror.Editor, event: KeyboardEvent): void {
    if (event.shiftKey) {
      return;
    }
    if (event.keyCode === UP_ARROW) {
      this.presenter.onPositionUp(this);
    } else if (event.keyCode === DOWN_ARROW) {
      this.presenter.onPositionDown(this);
    }
  }

}

// Define the signals for the `CodeMirrorCellEditorWidget` class.
defineSignal(CodeMirrorCellEditorWidget.prototype, 'edgeRequested');
开发者ID:TypeFox,项目名称:jupyterlab,代码行数:29,代码来源:editor.ts


示例8: _norm

   */
  private _norm(i: number): number {
    return i < 0 ? Math.floor(i) + this.internal.length : Math.floor(i);
  }

  /**
   * Check whether a normalized index is in range.
   */
  private _check(i: number): boolean {
    return i >= 0 && i < this.internal.length;
  }

  /**
   * Normalize and clamp an index to the list bounds.
   */
  private _clamp(i: number): number {
    return Math.max(0, Math.min(this._norm(i), this.internal.length));
  }

  /**
   * Normalize and limit a count to the length of the list.
   */
  private _limit(c: number): number {
    return Math.max(0, Math.min(Math.floor(c), this.internal.length));
  }
}


// Define the signals for the `ObservableList` class.
defineSignal(ObservableList.prototype, 'changed');
开发者ID:TypeFox,项目名称:jupyterlab,代码行数:30,代码来源:observablelist.ts



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript signaling.ISignal类代码示例发布时间:2022-05-25
下一篇:
TypeScript mimedata.MimeData类代码示例发布时间:2022-05-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap