Skip to content

Commit

Permalink
Merge pull request #35 from BearToCode/main
Browse files Browse the repository at this point in the history
Fix types exports
  • Loading branch information
matubu authored Jul 30, 2023
2 parents e3b7325 + 9b80941 commit fbe12cd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "1.1.9",
"description": "🌈 Light, fast, and easy to use, dependencies free javascript syntax highlighter, with automatic language detection",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
".": "./dist/index.js",
"./index.js": "./dist/index.js",
Expand Down Expand Up @@ -55,5 +56,10 @@
"@rollup/plugin-terser": "^0.4.3",
"rollup": "^2.75.7",
"rollup-plugin-copy": "^3.4.0"
},
"typesVersions": {
"*": {
"*": ["dist/*", "dist"]
}
}
}
7 changes: 5 additions & 2 deletions src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ export type ShjLanguageComponent =
match: RegExp;
sub:
| string
| ((code: string) => { type: string; sub: Array<{ match: RegExp; sub: string }> });
| ((code: string) => {
type: string;
sub: Array<{ match: RegExp; sub: string | Promise<string> }>
});
};

export type ShjLanguageDefinition = Array<ShjLanguageComponent>;
Expand Down Expand Up @@ -98,7 +101,7 @@ export declare function highlightElement<T extends string = ShjLanguage>(
* Call highlightElement on element with a css class starting with `shj-lang-`
* @param opt Customization options
*/
export declare function HighlightAll(opt?: ShjOptions): Promise<void>;
export declare function highlightAll(opt?: ShjOptions): Promise<void>;

/**
* Load a language and add it to the langs object
Expand Down

0 comments on commit fbe12cd

Please sign in to comment.