Skip to content

Commit eccf1a2

Browse files
committed
Export more types
1 parent ea88c15 commit eccf1a2

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

.changeset/green-rocks-act.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@code-hike/lighter": patch
3+
---
4+
5+
Export more types

lib/dist/index.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,4 @@ declare class UnknownThemeError extends Error {
5656
constructor(theme: string);
5757
}
5858

59-
export { UnknownLanguageError, UnknownThemeError, highlight };
59+
export { LanguageAlias, RawTheme, StringTheme, Theme, UnknownLanguageError, UnknownThemeError, highlight };

lib/src/index.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,16 @@ import {
66
} from "vscode-oniguruma";
77
// @ts-ignore
88
import onig from "vscode-oniguruma/release/onig.wasm";
9-
import { loadTheme, Theme } from "./theme";
9+
import { loadTheme, Theme, StringTheme, RawTheme } from "./theme";
1010
import { tokenize } from "./tokenizer.js";
1111
import { loadGrammarByScope } from "./grammars.js";
1212
import { aliasToLangData } from "./language";
1313
import { LanguageAlias } from "./language-data";
1414
import { getThemeColors } from "./theme-colors";
1515

16-
let registry: Registry | null = null;
16+
export { LanguageAlias, Theme, StringTheme, RawTheme };
1717

18+
let registry: Registry | null = null;
1819
export async function highlight(
1920
code: string,
2021
alias: LanguageAlias,

lib/src/theme.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ function getColorScheme(theme: RawTheme) {
7777
}
7878
}
7979

80-
type RawTheme = {
80+
export type RawTheme = {
8181
name?: string;
8282
type?: string;
8383
tokenColors?: ThemeSetting[];
@@ -127,6 +127,6 @@ const ALL_NAMES = [
127127
"solarized-light",
128128
] as const;
129129
type NamesTuple = typeof ALL_NAMES;
130-
type StringTheme = NamesTuple[number];
130+
export type StringTheme = NamesTuple[number];
131131

132132
export type Theme = StringTheme | RawTheme;

0 commit comments

Comments
 (0)