暂无描述
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

ui.d.ts 5.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. /// <reference path="jquery.d.ts" />
  2. /// <reference path="ace.d.ts" />
  3. /// <reference path="shortcut.d.ts" />
  4. declare module RpgCards {
  5. class Options {
  6. foreground_color: string;
  7. background_color: string;
  8. empty_color: string;
  9. default_color: string;
  10. default_icon: string;
  11. default_title_size: string;
  12. page_size: string;
  13. page_rows: number;
  14. page_columns: number;
  15. card_arrangement: string;
  16. card_size: string;
  17. card_count: number;
  18. icon_inline: boolean;
  19. constructor();
  20. }
  21. class Card {
  22. count: number;
  23. title: string;
  24. title_size: string;
  25. title_icon_text: string;
  26. color: string;
  27. color_front: string;
  28. color_back: string;
  29. icon: string;
  30. icon_front: string;
  31. icon_back: string;
  32. contents: string[];
  33. tags: string[];
  34. userData: any;
  35. constructor();
  36. static fromJSON(json: any): Card;
  37. toJSON(): any;
  38. duplicate(): Card;
  39. hasTag(tag: string): boolean;
  40. addTag(tag: string): void;
  41. removeTag(tag: string): void;
  42. findTag(pattern: string, flags?: string): string[];
  43. replaceTag(pattern: string, substitution: string, flags?: string): void;
  44. findContent(pattern: string, flags?: string): string[];
  45. replaceContent(pattern: string, substitution: string, flags?: string): void;
  46. findTitle(pattern: string, flags?: string): string[];
  47. findTitleAny(patterns: string[], flags?: string): string[];
  48. getTitle(options: Options): string;
  49. getTitleSize(options: Options): string;
  50. getTitleIconText(options: Options): string;
  51. getColorFront(options: Options): string;
  52. getColorBack(options: Options): string;
  53. getIconFront(options: Options): string;
  54. getIconBack(options: Options): string;
  55. }
  56. class CardDeck {
  57. cards: Card[];
  58. private _actions;
  59. constructor();
  60. toJSON(): any;
  61. static fromJSON(data: any): CardDeck;
  62. addCards(cards: Card[]): void;
  63. addNewCard(): Card;
  64. duplicateCard(card: Card): Card;
  65. deleteCard(card: Card): void;
  66. commit(): void;
  67. }
  68. class CardHtmlGenerator {
  69. constructor();
  70. private _icon(src, ind, ind0);
  71. private _subtitle(params, card, options, ind, ind0);
  72. private _ruler(params, card, options, ind, ind0);
  73. private _boxes(params, card, options, ind, ind0);
  74. private _property(params, card, options, ind, ind0);
  75. private _description(params, card, options, ind, ind0);
  76. private _text(params, card, options, ind, ind0);
  77. private _dndstats(params, card, options, ind, ind0);
  78. private _bullet(params, card, options, ind, ind0);
  79. private _section(params, card, options, ind, ind0);
  80. private _fill(params, card, options, ind, ind0);
  81. private _vspace(params, card, options, ind, ind0);
  82. private _unknown(params, card, options, ind, ind0);
  83. private _empty(params, card, options, ind, ind0);
  84. private _contents(contents, card, options, ind, ind0);
  85. private _title(card, options, ind, ind0);
  86. private _card_front(card, options, ind, ind0);
  87. private _card_back(card, options, ind, ind0);
  88. private _card_empty(options, ind, ind0);
  89. private _card(options, ind, ind0, content, color);
  90. /** Generates HTML for the front side of the given card */
  91. card_front(card: Card, options: Options, indent: string): string;
  92. /** Generates HTML for the back side of the given card */
  93. card_back(card: Card, options: Options, indent: string): string;
  94. /** Generates HTML for an empty given card */
  95. card_empty(options: Options, indent: string): string;
  96. }
  97. class PageHtmlGenerator {
  98. indent: string;
  99. constructor();
  100. private _pageColor(page, options);
  101. private _wrap(pageSet, options);
  102. private _generatePagesDoublesided(cards, options, rows, cols, generator);
  103. private _generatePagesFrontOnly(cards, options, rows, cols, generator);
  104. private _generatePagesSideBySide(cards, options, rows, cols, generator);
  105. private _generatePages(cards, options, rows, cols, generator);
  106. private _generateStyle(options);
  107. generateHtml(cards: Card[], options: Options): string;
  108. insertInto(cards: Card[], options: Options, container: HTMLElement): void;
  109. }
  110. }
  111. declare module RpgCardsUI {
  112. var css_color_names: string[];
  113. var card_colors: {
  114. "": string;
  115. "dimgray": string;
  116. "black": string;
  117. "darkgoldenrod": string;
  118. "saddlebrown": string;
  119. "indianred": string;
  120. "maroon": string;
  121. "indigo": string;
  122. "darkblue": string;
  123. "royalblue": string;
  124. "darkgreen": string;
  125. "#666633": string;
  126. "rgb(140, 83, 133)": string;
  127. "rgb(255, 173, 70)": string;
  128. "rgb(96, 184, 93)": string;
  129. "rgb(59, 175, 177)": string;
  130. "rgb(128, 0, 0)": string;
  131. "rgb(133, 112, 86)": string;
  132. "rgb(248, 58, 34)": string;
  133. };
  134. }
  135. declare module RpgCardsUI {
  136. var icon_names: string[];
  137. }
  138. declare module RpgCardsUI {
  139. var card_data_example: {
  140. "count": number;
  141. "color": string;
  142. "title": string;
  143. "icon": string;
  144. "contents": string[];
  145. "tags": string[];
  146. }[];
  147. }
  148. declare module RpgCardsUI {
  149. function toggle_menu(): void;
  150. }