mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 15:28:57 +00:00
feat(assets): add TypeScript type declarations for Hugo @params module
Add proper type definitions for Hugo's `@params` virtual module, configure tsconfig paths/typeRoots for resolution, and remove the @ts-expect-error suppress in color-scheme.ts. Also fix nil input handling in camel-case-keys.
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
// @ts-expect-error — Hugo js.Build virtual module
|
||||
import params from '@params'
|
||||
|
||||
/**
|
||||
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Hugo `@params` type declarations
|
||||
* This file provides TypeScript type definitions for Hugo's `@params` module
|
||||
*/
|
||||
|
||||
declare module '@params' {
|
||||
export const defaultTheme: string
|
||||
}
|
||||
@@ -4,6 +4,12 @@
|
||||
"lib": ["DOM", "DOM.Iterable", "ESNext"],
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "bundler",
|
||||
"paths": {
|
||||
"@params": ["./js/types/params"]
|
||||
},
|
||||
"typeRoots": [
|
||||
"./js/types"
|
||||
],
|
||||
"strict": true,
|
||||
"noUnusedLocals": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
// Practical usage in templates
|
||||
{{- $siteParams := partial "function/camel-case-keys.html" .Site.Params }}
|
||||
*/ -}}
|
||||
{{- $input := . -}}
|
||||
{{- $input := . | default dict -}}
|
||||
{{- $output := dict -}}
|
||||
|
||||
{{- if reflect.IsMap $input -}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{- hugo.Store.Set "version" "v1.0.0-mrn0yyrp" -}}
|
||||
{{- hugo.Store.Set "version" "v1.0.0-mrn7n5sf" -}}
|
||||
{{- .Store.Set "this" dict -}}
|
||||
|
||||
{{- partial "init/detection-env.html" . -}}
|
||||
|
||||
Reference in New Issue
Block a user