monaco.contribution.d.ts 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. import { IEvent } from './fillers/monaco-editor-core';
  2. export interface Options {
  3. readonly validate?: boolean;
  4. readonly lint?: {
  5. readonly compatibleVendorPrefixes?: 'ignore' | 'warning' | 'error';
  6. readonly vendorPrefix?: 'ignore' | 'warning' | 'error';
  7. readonly duplicateProperties?: 'ignore' | 'warning' | 'error';
  8. readonly emptyRules?: 'ignore' | 'warning' | 'error';
  9. readonly importStatement?: 'ignore' | 'warning' | 'error';
  10. readonly boxModel?: 'ignore' | 'warning' | 'error';
  11. readonly universalSelector?: 'ignore' | 'warning' | 'error';
  12. readonly zeroUnits?: 'ignore' | 'warning' | 'error';
  13. readonly fontFaceProperties?: 'ignore' | 'warning' | 'error';
  14. readonly hexColorLength?: 'ignore' | 'warning' | 'error';
  15. readonly argumentsInColorFunction?: 'ignore' | 'warning' | 'error';
  16. readonly unknownProperties?: 'ignore' | 'warning' | 'error';
  17. readonly ieHack?: 'ignore' | 'warning' | 'error';
  18. readonly unknownVendorSpecificProperties?: 'ignore' | 'warning' | 'error';
  19. readonly propertyIgnoredDueToDisplay?: 'ignore' | 'warning' | 'error';
  20. readonly important?: 'ignore' | 'warning' | 'error';
  21. readonly float?: 'ignore' | 'warning' | 'error';
  22. readonly idSelector?: 'ignore' | 'warning' | 'error';
  23. };
  24. /**
  25. * Configures the CSS data types known by the langauge service.
  26. */
  27. readonly data?: CSSDataConfiguration;
  28. }
  29. export interface ModeConfiguration {
  30. /**
  31. * Defines whether the built-in completionItemProvider is enabled.
  32. */
  33. readonly completionItems?: boolean;
  34. /**
  35. * Defines whether the built-in hoverProvider is enabled.
  36. */
  37. readonly hovers?: boolean;
  38. /**
  39. * Defines whether the built-in documentSymbolProvider is enabled.
  40. */
  41. readonly documentSymbols?: boolean;
  42. /**
  43. * Defines whether the built-in definitions provider is enabled.
  44. */
  45. readonly definitions?: boolean;
  46. /**
  47. * Defines whether the built-in references provider is enabled.
  48. */
  49. readonly references?: boolean;
  50. /**
  51. * Defines whether the built-in references provider is enabled.
  52. */
  53. readonly documentHighlights?: boolean;
  54. /**
  55. * Defines whether the built-in rename provider is enabled.
  56. */
  57. readonly rename?: boolean;
  58. /**
  59. * Defines whether the built-in color provider is enabled.
  60. */
  61. readonly colors?: boolean;
  62. /**
  63. * Defines whether the built-in foldingRange provider is enabled.
  64. */
  65. readonly foldingRanges?: boolean;
  66. /**
  67. * Defines whether the built-in diagnostic provider is enabled.
  68. */
  69. readonly diagnostics?: boolean;
  70. /**
  71. * Defines whether the built-in selection range provider is enabled.
  72. */
  73. readonly selectionRanges?: boolean;
  74. }
  75. export interface LanguageServiceDefaults {
  76. readonly languageId: string;
  77. readonly onDidChange: IEvent<LanguageServiceDefaults>;
  78. readonly modeConfiguration: ModeConfiguration;
  79. readonly options: Options;
  80. setOptions(options: Options): void;
  81. setModeConfiguration(modeConfiguration: ModeConfiguration): void;
  82. /** @deprecated Use options instead */
  83. readonly diagnosticsOptions: DiagnosticsOptions;
  84. /** @deprecated Use setOptions instead */
  85. setDiagnosticsOptions(options: DiagnosticsOptions): void;
  86. }
  87. /** @deprecated Use Options instead */
  88. export declare type DiagnosticsOptions = Options;
  89. export declare const cssDefaults: LanguageServiceDefaults;
  90. export declare const scssDefaults: LanguageServiceDefaults;
  91. export declare const lessDefaults: LanguageServiceDefaults;
  92. export interface CSSDataConfiguration {
  93. /**
  94. * Defines whether the standard CSS properties, at-directives, pseudoClasses and pseudoElements are shown.
  95. */
  96. useDefaultDataProvider?: boolean;
  97. /**
  98. * Provides a set of custom data providers.
  99. */
  100. dataProviders?: {
  101. [providerId: string]: CSSDataV1;
  102. };
  103. }
  104. /**
  105. * Custom CSS properties, at-directives, pseudoClasses and pseudoElements
  106. * https://github.com/microsoft/vscode-css-languageservice/blob/main/docs/customData.md
  107. */
  108. export interface CSSDataV1 {
  109. version: 1 | 1.1;
  110. properties?: IPropertyData[];
  111. atDirectives?: IAtDirectiveData[];
  112. pseudoClasses?: IPseudoClassData[];
  113. pseudoElements?: IPseudoElementData[];
  114. }
  115. export declare type EntryStatus = 'standard' | 'experimental' | 'nonstandard' | 'obsolete';
  116. export interface IReference {
  117. name: string;
  118. url: string;
  119. }
  120. export interface IPropertyData {
  121. name: string;
  122. description?: string | MarkupContent;
  123. browsers?: string[];
  124. restrictions?: string[];
  125. status?: EntryStatus;
  126. syntax?: string;
  127. values?: IValueData[];
  128. references?: IReference[];
  129. relevance?: number;
  130. }
  131. export interface IAtDirectiveData {
  132. name: string;
  133. description?: string | MarkupContent;
  134. browsers?: string[];
  135. status?: EntryStatus;
  136. references?: IReference[];
  137. }
  138. export interface IPseudoClassData {
  139. name: string;
  140. description?: string | MarkupContent;
  141. browsers?: string[];
  142. status?: EntryStatus;
  143. references?: IReference[];
  144. }
  145. export interface IPseudoElementData {
  146. name: string;
  147. description?: string | MarkupContent;
  148. browsers?: string[];
  149. status?: EntryStatus;
  150. references?: IReference[];
  151. }
  152. export interface IValueData {
  153. name: string;
  154. description?: string | MarkupContent;
  155. browsers?: string[];
  156. status?: EntryStatus;
  157. references?: IReference[];
  158. }
  159. export interface MarkupContent {
  160. kind: MarkupKind;
  161. value: string;
  162. }
  163. export declare type MarkupKind = 'plaintext' | 'markdown';