@unocss/language-server 66.6.8 → 66.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1,4 +1,3 @@
1
- import * as _$_unocss_core0 from "@unocss/core";
2
1
  import { UnoGenerator, UnocssPluginContext, UserConfig } from "@unocss/core";
3
2
  import { Connection } from "vscode-languageserver";
4
3
 
@@ -20,7 +19,7 @@ declare class ContextManager {
20
19
  private discoveredConfigs;
21
20
  private readonly defaultUnocssConfig;
22
21
  private readonly workspaceRoots;
23
- events: _$_unocss_core0.Emitter<{
22
+ events: import("@unocss/core").Emitter<{
24
23
  reload: () => void;
25
24
  unload: (context: UnocssPluginContext<UserConfig<any>>) => void;
26
25
  contextLoaded: (context: UnocssPluginContext<UserConfig<any>>) => void;
@@ -78,6 +77,51 @@ interface MatchedPosition {
78
77
  text: string;
79
78
  }
80
79
  //#endregion
80
+ //#region ../../node_modules/.pnpm/vscode-languageserver-types@3.17.5/node_modules/vscode-languageserver-types/lib/esm/main.d.ts
81
+ /**
82
+ * Defines a decimal number. Since decimal numbers are very
83
+ * rare in the language server specification we denote the
84
+ * exact range with every decimal using the mathematics
85
+ * interval notations (e.g. [0, 1] denotes all decimals d with
86
+ * 0 <= d <= 1.
87
+ */
88
+ type decimal = number;
89
+ /**
90
+ * Represents a color in RGBA space.
91
+ */
92
+ interface Color {
93
+ /**
94
+ * The red component of this color in the range [0-1].
95
+ */
96
+ readonly red: decimal;
97
+ /**
98
+ * The green component of this color in the range [0-1].
99
+ */
100
+ readonly green: decimal;
101
+ /**
102
+ * The blue component of this color in the range [0-1].
103
+ */
104
+ readonly blue: decimal;
105
+ /**
106
+ * The alpha component of this color in the range [0-1].
107
+ */
108
+ readonly alpha: decimal;
109
+ }
110
+ /**
111
+ * The Color namespace provides helper functions to work with
112
+ * {@link Color} literals.
113
+ */
114
+ declare namespace Color {
115
+ /**
116
+ * Creates a new Color literal.
117
+ */
118
+ function create(red: decimal, green: decimal, blue: decimal, alpha: decimal): Color;
119
+ /**
120
+ * Checks whether the given literal conforms to the {@link Color} interface.
121
+ */
122
+ function is(value: any): value is Color;
123
+ }
124
+ //#endregion
81
125
  //#region src/utils/color.d.ts
82
126
  /**
83
127
  * Get CSS color string from CSS string
@@ -111,13 +155,7 @@ interface MatchedPosition {
111
155
  * @returns The **first** CSS color string (hex, rgb[a], hsl[a]) or `undefined`
112
156
  */
113
157
  declare function getColorString(str: string): string | undefined;
114
- declare function convertToRGBA(rgbColor: string): string;
115
- declare function parseColorToRGBA(colorString: string): {
116
- red: number;
117
- green: number;
118
- blue: number;
119
- alpha: number;
120
- } | undefined;
158
+ declare function parseColorToRGBA(colorString: string): Color | undefined;
121
159
  //#endregion
122
160
  //#region src/utils/css.d.ts
123
161
  /**
@@ -127,7 +165,7 @@ declare function parseColorToRGBA(colorString: string): {
127
165
  * @param str
128
166
  */
129
167
  declare function addRemToPxComment(str?: string, remToPixel?: number): string;
130
- declare function getCSS(uno: UnoGenerator, utilName: string | string[]): Promise<string>;
168
+ declare function getCSS(uno: UnoGenerator, utilName: string | string[], preflights?: boolean): Promise<string>;
131
169
  declare function getPrettiedCSS(uno: UnoGenerator, util: string | string[], remToPxRatio: number): Promise<{
132
170
  prettified: string;
133
171
  css: string;
@@ -158,4 +196,4 @@ declare function shouldProvideAutocomplete(code: string, id: string, offset: num
158
196
  declare function isVueWithPug(code: string, id: string): boolean;
159
197
  declare function isSubdir(parent: string, child: string): boolean | "";
160
198
  //#endregion
161
- export { ContextManager, type MatchedPosition, type ServerSettings, type UnoContext, addRemToPxComment, clearDocumentCache, convertToRGBA, defaultSettings, getCSS, getColorString, getMatchedPositionsFromCode, getMatchedPositionsFromDoc, getPrettiedCSS, getPrettiedMarkdown, isSubdir, isVueWithPug, parseColorToRGBA, shouldProvideAutocomplete };
199
+ export { ContextManager, type MatchedPosition, type ServerSettings, type UnoContext, addRemToPxComment, clearDocumentCache, defaultSettings, getCSS, getColorString, getMatchedPositionsFromCode, getMatchedPositionsFromDoc, getPrettiedCSS, getPrettiedMarkdown, isSubdir, isVueWithPug, parseColorToRGBA, shouldProvideAutocomplete };