浏览代码

Clean up clipboard

Steven Silvester 8 年之前
父节点
当前提交
51982f23e5
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      src/clipboard/index.ts

+ 3 - 2
src/clipboard/index.ts

@@ -9,6 +9,7 @@ import {
   Token
 } from 'phosphor/lib/core/token';
 
+
 /* tslint:disable */
 /**
  * The clipboard token.
@@ -49,14 +50,14 @@ function copyToClipboard(text: string): void {
  *
  * @param node - The element on which to generate the event.
  *
- * @param type - The type of event to generate: `'copy'` or `'cut'`.
+ * @param type - The type of event to generate.
  *   `'paste'` events cannot be programmatically generated.
  *
  * #### Notes
  * This can only be called in response to a user input event.
  */
 export
-function generateClipboardEvent(node: HTMLElement, type='copy'): void {
+function generateClipboardEvent(node: HTMLElement, type: 'copy' | 'cut' = 'copy'): void {
   // http://stackoverflow.com/a/5210367
 
   // Identify selected text.