Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

doc.d.ts 7.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. import { Doc } from './';
  2. // https://github.com/prettier/prettier/blob/main/src/document/index.js
  3. export namespace builders {
  4. type DocCommand =
  5. | Align
  6. | BreakParent
  7. | Concat
  8. | Cursor
  9. | Fill
  10. | Group
  11. | IfBreak
  12. | Indent
  13. | IndentIfBreak
  14. | Label
  15. | Line
  16. | LineSuffix
  17. | LineSuffixBoundary
  18. | Trim;
  19. type Doc = string | Doc[] | DocCommand;
  20. interface Align {
  21. type: 'align';
  22. contents: Doc;
  23. n: number | string | { type: 'root' };
  24. }
  25. interface BreakParent {
  26. type: 'break-parent';
  27. }
  28. interface Concat {
  29. type: 'concat';
  30. parts: Doc[];
  31. }
  32. interface Cursor {
  33. type: 'cursor';
  34. placeholder: symbol;
  35. }
  36. interface Fill {
  37. type: 'fill';
  38. parts: Doc[];
  39. }
  40. interface Group {
  41. type: 'group';
  42. contents: Doc;
  43. break: boolean;
  44. expandedStates: Doc[];
  45. }
  46. interface HardlineWithoutBreakParent extends Line {
  47. hard: true;
  48. }
  49. interface IfBreak {
  50. type: 'if-break';
  51. breakContents: Doc;
  52. flatContents: Doc;
  53. }
  54. interface Indent {
  55. type: 'indent';
  56. contents: Doc;
  57. }
  58. interface IndentIfBreak {
  59. type: 'indent-if-break';
  60. }
  61. interface Label {
  62. type: 'label';
  63. }
  64. interface Line {
  65. type: 'line';
  66. soft?: boolean | undefined;
  67. hard?: boolean | undefined;
  68. literal?: boolean | undefined;
  69. }
  70. interface LineSuffix {
  71. type: 'line-suffix';
  72. contents: Doc;
  73. }
  74. interface LineSuffixBoundary {
  75. type: 'line-suffix-boundary';
  76. }
  77. interface LiterallineWithoutBreakParent extends Line {
  78. hard: true;
  79. literal: true;
  80. }
  81. interface Softline extends Line {
  82. soft: true;
  83. }
  84. interface Trim {
  85. type: 'trim';
  86. }
  87. interface GroupOptions {
  88. shouldBreak?: boolean | undefined;
  89. id?: symbol | undefined;
  90. }
  91. function addAlignmentToDoc(doc: Doc, size: number, tabWidth: number): Doc;
  92. /** @see [align](https://github.com/prettier/prettier/blob/main/commands.md#align) */
  93. function align(widthOrString: Align['n'], doc: Doc): Align;
  94. /** @see [breakParent](https://github.com/prettier/prettier/blob/main/commands.md#breakparent) */
  95. const breakParent: BreakParent;
  96. /**
  97. * @see [concat](https://github.com/prettier/prettier/blob/main/commands.md#deprecated-concat)
  98. * @deprecated use `Doc[]` instead
  99. */
  100. function concat(docs: Doc[]): Concat;
  101. /** @see [conditionalGroup](https://github.com/prettier/prettier/blob/main/commands.md#conditionalgroup) */
  102. function conditionalGroup(alternatives: Doc[], options?: GroupOptions): Group;
  103. /** @see [dedent](https://github.com/prettier/prettier/blob/main/commands.md#dedent) */
  104. function dedent(doc: Doc): Align;
  105. /** @see [dedentToRoot](https://github.com/prettier/prettier/blob/main/commands.md#dedenttoroot) */
  106. function dedentToRoot(doc: Doc): Align;
  107. /** @see [fill](https://github.com/prettier/prettier/blob/main/commands.md#fill) */
  108. function fill(docs: Doc[]): Fill;
  109. /** @see [group](https://github.com/prettier/prettier/blob/main/commands.md#group) */
  110. function group(doc: Doc, opts?: GroupOptions): Group;
  111. /** @see [hardline](https://github.com/prettier/prettier/blob/main/commands.md#hardline) */
  112. const hardline: Concat;
  113. /** @see [hardlineWithoutBreakParent](https://github.com/prettier/prettier/blob/main/commands.md#hardlinewithoutbreakparent-and-literallinewithoutbreakparent) */
  114. const hardlineWithoutBreakParent: HardlineWithoutBreakParent;
  115. /** @see [ifBreak](https://github.com/prettier/prettier/blob/main/commands.md#ifbreak) */
  116. function ifBreak(ifBreak: Doc, noBreak?: Doc, options?: { groupId?: symbol | undefined }): IfBreak;
  117. /** @see [indent](https://github.com/prettier/prettier/blob/main/commands.md#indent) */
  118. function indent(doc: Doc): Indent;
  119. /** @see [indentIfBreak](https://github.com/prettier/prettier/blob/main/commands.md#indentifbreak) */
  120. function indentIfBreak(doc: Doc, opts: { groupId: symbol; negate?: boolean | undefined }): IndentIfBreak;
  121. /** @see [join](https://github.com/prettier/prettier/blob/main/commands.md#join) */
  122. function join(sep: Doc, docs: Doc[]): Concat;
  123. /** @see [label](https://github.com/prettier/prettier/blob/main/commands.md#label) */
  124. function label(label: string, doc: Doc): Label;
  125. /** @see [line](https://github.com/prettier/prettier/blob/main/commands.md#line) */
  126. const line: Line;
  127. /** @see [lineSuffix](https://github.com/prettier/prettier/blob/main/commands.md#linesuffix) */
  128. function lineSuffix(suffix: Doc): LineSuffix;
  129. /** @see [lineSuffixBoundary](https://github.com/prettier/prettier/blob/main/commands.md#linesuffixboundary) */
  130. const lineSuffixBoundary: LineSuffixBoundary;
  131. /** @see [literalline](https://github.com/prettier/prettier/blob/main/commands.md#literalline) */
  132. const literalline: Concat;
  133. /** @see [literallineWithoutBreakParent](https://github.com/prettier/prettier/blob/main/commands.md#hardlinewithoutbreakparent-and-literallinewithoutbreakparent) */
  134. const literallineWithoutBreakParent: LiterallineWithoutBreakParent;
  135. /** @see [markAsRoot](https://github.com/prettier/prettier/blob/main/commands.md#markasroot) */
  136. function markAsRoot(doc: Doc): Align;
  137. /** @see [softline](https://github.com/prettier/prettier/blob/main/commands.md#softline) */
  138. const softline: Softline;
  139. /** @see [trim](https://github.com/prettier/prettier/blob/main/commands.md#trim) */
  140. const trim: Trim;
  141. /** @see [cursor](https://github.com/prettier/prettier/blob/main/commands.md#cursor) */
  142. const cursor: Cursor;
  143. }
  144. export namespace debug {
  145. function printDocToDebug(doc: Doc): string;
  146. }
  147. export namespace printer {
  148. function printDocToString(
  149. doc: Doc,
  150. options: Options,
  151. ): {
  152. formatted: string;
  153. cursorNodeStart?: number | undefined;
  154. cursorNodeText?: string | undefined;
  155. };
  156. interface Options {
  157. /**
  158. * Specify the line length that the printer will wrap on.
  159. * @default 80
  160. */
  161. printWidth: number;
  162. /**
  163. * Specify the number of spaces per indentation-level.
  164. * @default 2
  165. */
  166. tabWidth: number;
  167. /**
  168. * Indent lines with tabs instead of spaces
  169. * @default false
  170. */
  171. useTabs: boolean;
  172. parentParser?: string | undefined;
  173. __embeddedInHtml?: boolean | undefined;
  174. }
  175. }
  176. export namespace utils {
  177. function cleanDoc(doc: Doc): Doc;
  178. function findInDoc<T = Doc>(doc: Doc, callback: (doc: Doc) => T, defaultValue: T): T;
  179. function getDocParts(doc: Doc): Doc;
  180. function isConcat(doc: Doc): boolean;
  181. function isEmpty(doc: Doc): boolean;
  182. function isLineNext(doc: Doc): boolean;
  183. function mapDoc<T = Doc>(doc: Doc, callback: (doc: Doc) => T): T;
  184. function normalizeDoc(doc: Doc): Doc;
  185. function normalizeParts(parts: Doc[]): Doc[];
  186. function propagateBreaks(doc: Doc): void;
  187. function removeLines(doc: Doc): Doc;
  188. function replaceNewlinesWithLiterallines(doc: Doc): Doc;
  189. function stripTrailingHardline(doc: Doc): Doc;
  190. function traverseDoc(
  191. doc: Doc,
  192. onEnter?: (doc: Doc) => void | boolean,
  193. onExit?: (doc: Doc) => void,
  194. shouldTraverseConditionalGroups?: boolean,
  195. ): void;
  196. function willBreak(doc: Doc): boolean;
  197. }