feat: enhance connection validation and node creation logic, improve type handling in various components
This commit is contained in:
18
frontend/src/nunjucks.d.ts
vendored
Normal file
18
frontend/src/nunjucks.d.ts
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
declare module 'nunjucks' {
|
||||
export interface Loader {
|
||||
getSource(name: string): { src: string; path: string } | null
|
||||
}
|
||||
export interface Environment {
|
||||
render(name: string, context: Record<string, unknown>, callback: (err: Error | null, res: string) => void): void
|
||||
addFilter(name: string, fn: (...args: unknown[]) => void, async?: boolean): void
|
||||
getFilter(name: string): (...args: unknown[]) => void
|
||||
}
|
||||
export class Environment {
|
||||
constructor(loaders?: Loader[], opts?: { autoescape?: boolean })
|
||||
render(name: string, context: Record<string, unknown>, callback: (err: Error | null, res: string) => void): void
|
||||
addFilter(name: string, fn: (...args: unknown[]) => void, async?: boolean): void
|
||||
getFilter(name: string): (...args: unknown[]) => void
|
||||
}
|
||||
const nunjucks: { Environment: typeof Environment }
|
||||
export default nunjucks
|
||||
}
|
||||
Reference in New Issue
Block a user