Skip to content

Commit

Permalink
feat: add types (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
tujoworker authored Aug 31, 2023
1 parent 6ea24e5 commit 18fad2e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/gatsby-plugin-eufemia-theme-handler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@
},
"main": "index.js",
"module": "index.js",
"types": "themeHandler.d.ts",
"exports": {
".": {
"module": "./index.js",
"default": "./index.js"
},
"./collectThemes.js": "./collectThemes.js",
"./themeHandler.js": "./themeHandler.js",
"./themeHandler.d.ts": "./themeHandler.d.ts",
"./inlineScriptDev.mjs": "./inlineScriptDev.mjs",
"./inlineScriptProd.mjs": "./inlineScriptProd.mjs",
"./gatsby-node.js": "./gatsby-node.js",
Expand Down
18 changes: 18 additions & 0 deletions packages/gatsby-plugin-eufemia-theme-handler/themeHandler.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
type PropMapping = string
export type ThemesItem = {
name: string
file: string
hide?: boolean
isDev?: boolean
propMapping: PropMapping
}
export type Themes = Array<ThemesItem>
export const getThemes = (): Themes => null
export const isValidTheme = (): boolean => null
export const getTheme = (): ThemesItem => null
export const useTheme = (): ThemesItem => null
const callback = () => null
export const setTheme = (
props: { name?: string; propMapping?: PropMapping },
callback = null
): void => null

0 comments on commit 18fad2e

Please sign in to comment.