@kubb/react
Advanced tools
Comparing version 1.12.0-canary.20231018T090612 to 1.12.0-canary.20231018T095837
@@ -1,3 +0,3 @@ | ||
import { Import, Export } from '@kubb/core'; | ||
import { ReactNode } from 'react'; | ||
import { KubbFile, Logger } from '@kubb/core'; | ||
import { ReactNode, Key } from 'react'; | ||
@@ -9,3 +9,32 @@ type AppContextProps<Meta extends Record<string, unknown> = Record<string, unknown>> = { | ||
type ReactElementNames = 'br'; | ||
type ElementNames = ReactElementNames | 'kubb-text' | 'kubb-import' | 'kubb-export' | 'kubb-root' | 'kubb-app'; | ||
declare global { | ||
namespace JSX { | ||
interface IntrinsicElements { | ||
'kubb-text': { | ||
children?: ReactNode; | ||
key?: Key; | ||
}; | ||
'kubb-file': { | ||
children?: ReactNode; | ||
key?: Key; | ||
baseName: string; | ||
path: string; | ||
env?: NodeJS.ProcessEnv; | ||
}; | ||
'kubb-source': { | ||
children?: ReactNode; | ||
key?: Key; | ||
path?: string; | ||
print?: boolean; | ||
}; | ||
'kubb-import': KubbFile.Import & { | ||
print?: boolean; | ||
}; | ||
'kubb-export': KubbFile.Export & { | ||
print?: boolean; | ||
}; | ||
} | ||
} | ||
} | ||
type ElementNames = ReactElementNames | 'kubb-text' | 'kubb-file' | 'kubb-source' | 'kubb-import' | 'kubb-export' | 'kubb-root' | 'kubb-app'; | ||
type Node = { | ||
@@ -47,11 +76,11 @@ parentNode: DOMElement | undefined; | ||
*/ | ||
imports: Import[]; | ||
/** | ||
* Custom for Kubb | ||
*/ | ||
exports: Export[]; | ||
file?: KubbFile.File; | ||
}; | ||
declare function createRoot<Context extends AppContextProps = AppContextProps>(container?: DOMElement): RootType<Context>; | ||
type Props = { | ||
container?: DOMElement; | ||
logger?: Logger; | ||
}; | ||
declare function createRoot<Context extends AppContextProps = AppContextProps>({ container, logger }?: Props): RootType<Context>; | ||
export { createRoot, createRoot as default }; | ||
export { RootType, createRoot, createRoot as default }; |
@@ -0,7 +1,36 @@ | ||
import { KubbFile, Logger, PluginManager, FileManager } from '@kubb/core'; | ||
import * as react from 'react'; | ||
import { ReactNode } from 'react'; | ||
import { Import as Import$1, Export as Export$1, PluginManager, FileManager } from '@kubb/core'; | ||
import { ReactNode, Key } from 'react'; | ||
type ReactElementNames = 'br'; | ||
type ElementNames = ReactElementNames | 'kubb-text' | 'kubb-import' | 'kubb-export' | 'kubb-root' | 'kubb-app'; | ||
declare global { | ||
namespace JSX { | ||
interface IntrinsicElements { | ||
'kubb-text': { | ||
children?: ReactNode; | ||
key?: Key; | ||
}; | ||
'kubb-file': { | ||
children?: ReactNode; | ||
key?: Key; | ||
baseName: string; | ||
path: string; | ||
env?: NodeJS.ProcessEnv; | ||
}; | ||
'kubb-source': { | ||
children?: ReactNode; | ||
key?: Key; | ||
path?: string; | ||
print?: boolean; | ||
}; | ||
'kubb-import': KubbFile.Import & { | ||
print?: boolean; | ||
}; | ||
'kubb-export': KubbFile.Export & { | ||
print?: boolean; | ||
}; | ||
} | ||
} | ||
} | ||
type ElementNames = ReactElementNames | 'kubb-text' | 'kubb-file' | 'kubb-source' | 'kubb-import' | 'kubb-export' | 'kubb-root' | 'kubb-app'; | ||
type Node = { | ||
@@ -36,15 +65,17 @@ parentNode: DOMElement | undefined; | ||
type Props$5 = { | ||
type Props$7 = { | ||
children?: ReactNode; | ||
indentSize?: number; | ||
}; | ||
declare function Text({ indentSize, children }: Props$5): ReactNode; | ||
declare function Text({ indentSize, children }: Props$7): ReactNode; | ||
type Props$4<Meta extends Record<string, unknown> = Record<string, unknown>> = { | ||
type Props$6<Meta extends Record<string, unknown> = Record<string, unknown>> = { | ||
onError: (error: Error) => void; | ||
meta: Meta; | ||
logger?: Logger; | ||
children?: ReactNode; | ||
}; | ||
declare function App<Meta extends Record<string, unknown> = Record<string, unknown>>({ meta, children }: Props$4<Meta>): ReactNode; | ||
declare function App<Meta extends Record<string, unknown> = Record<string, unknown>>({ onError, logger, meta, children }: Props$6<Meta>): ReactNode; | ||
type Props$3 = { | ||
type Props$5 = { | ||
name: string; | ||
@@ -61,7 +92,7 @@ export?: boolean; | ||
}; | ||
declare function Function({ name, export: canExport, async, generics, params, returnType, JSDoc, children }: Props$3): ReactNode; | ||
declare function Function({ name, export: canExport, async, generics, params, returnType, JSDoc, children }: Props$5): ReactNode; | ||
declare namespace Function { | ||
var Arrow: typeof ArrowFunction; | ||
} | ||
type ArrowFunctionProps = Props$3 & { | ||
type ArrowFunctionProps = Props$5 & { | ||
singleLine?: boolean; | ||
@@ -72,12 +103,36 @@ }; | ||
type Props$2 = Import$1 & { | ||
type Props$4 = KubbFile.Import & { | ||
print?: boolean; | ||
}; | ||
declare function Import({ name, path, isTypeOnly, print: printImport }: Props$2): ReactNode; | ||
declare function Import({ name, path, isTypeOnly, print: printImport }: Props$4): ReactNode; | ||
type Props$1 = Export$1 & { | ||
type Props$3 = KubbFile.Export & { | ||
print?: boolean; | ||
}; | ||
declare function Export({ name, path, isTypeOnly, asAlias, print: printExport }: Props$1): ReactNode; | ||
declare function Export({ name, path, isTypeOnly, asAlias, print: printExport }: Props$3): ReactNode; | ||
type BaseProps = { | ||
baseName?: never; | ||
path?: KubbFile.Path; | ||
} | { | ||
baseName: KubbFile.BaseName; | ||
path: KubbFile.Path; | ||
}; | ||
type Props$2 = BaseProps & { | ||
env?: NodeJS.ProcessEnv; | ||
children?: ReactNode; | ||
}; | ||
declare function File({ baseName, path, env, children }: Props$2): ReactNode; | ||
declare namespace File { | ||
var Export: typeof Export; | ||
var Import: typeof Import; | ||
var Source: typeof FileSource; | ||
} | ||
type FileSourceProps = { | ||
print?: boolean; | ||
path?: string; | ||
children?: ReactNode; | ||
}; | ||
declare function FileSource({ path, print, children }: FileSourceProps): ReactNode; | ||
type AppContextProps<Meta extends Record<string, unknown> = Record<string, unknown>> = { | ||
@@ -92,3 +147,3 @@ meta: Meta; | ||
type Props = { | ||
type Props$1 = { | ||
size: number; | ||
@@ -98,3 +153,3 @@ children?: React.ReactNode; | ||
declare function createIndent(size: number): string; | ||
declare function useIndent({ size, children }: Props): React.ReactNode; | ||
declare function useIndent({ size, children }: Props$1): React.ReactNode; | ||
@@ -112,5 +167,7 @@ declare function usePluginManager(): PluginManager; | ||
declare const setTextNodeValue: (node: TextNode, text: string) => void; | ||
declare const nodeNames: ElementNames[]; | ||
type ReactTemplateOptions = { | ||
debug: boolean; | ||
logger?: Logger; | ||
debug?: boolean; | ||
}; | ||
@@ -121,4 +178,3 @@ declare class ReactTemplate<Context extends AppContextProps = AppContextProps> { | ||
private lastOutput; | ||
private lastImports; | ||
private lastExports; | ||
private lastFile?; | ||
private readonly container; | ||
@@ -129,4 +185,3 @@ private readonly rootNode; | ||
get output(): string; | ||
get imports(): Import$1[]; | ||
get exports(): Export$1[]; | ||
get file(): KubbFile.File | undefined; | ||
resized: () => void; | ||
@@ -137,2 +192,3 @@ resolveExitPromise: () => void; | ||
onRender: () => void; | ||
onError(_error: Error): void; | ||
render(node: ReactNode, context?: Context): void; | ||
@@ -144,13 +200,16 @@ unmount(error?: Error | number | null): void; | ||
output: string; | ||
imports: Import$1[]; | ||
exports: Export$1[]; | ||
imports: Array<KubbFile.Import>; | ||
exports: Array<KubbFile.Export>; | ||
file?: KubbFile.File; | ||
}; | ||
declare function renderer(node: DOMElement): Result; | ||
declare function squashExportNodes(node: DOMElement): Export$1[]; | ||
declare function squashExportNodes(node: DOMElement): Array<KubbFile.Export>; | ||
declare function squashImportNodes(node: DOMElement): Import$1[]; | ||
declare function squashImportNodes(node: DOMElement): Array<KubbFile.Import>; | ||
declare function squashTextNodes(node: DOMElement): string; | ||
declare function getFile(node: DOMElement): KubbFile.File | undefined; | ||
type RootType<T = unknown> = { | ||
@@ -163,11 +222,11 @@ render(children: ReactNode, context?: T): void; | ||
*/ | ||
imports: Import$1[]; | ||
/** | ||
* Custom for Kubb | ||
*/ | ||
exports: Export$1[]; | ||
file?: KubbFile.File; | ||
}; | ||
declare function createRoot<Context extends AppContextProps = AppContextProps>(container?: DOMElement): RootType<Context>; | ||
type Props = { | ||
container?: DOMElement; | ||
logger?: Logger; | ||
}; | ||
declare function createRoot<Context extends AppContextProps = AppContextProps>({ container, logger }?: Props): RootType<Context>; | ||
export { App, AppContext, AppContextProps, ArrowFunction, DOMElement, DOMNode, DOMNodeAttribute, ElementNames, Export, Fun, Function, Import, Node, NodeNames, ReactTemplate, ReactTemplateOptions, Text, TextNode, appendChildNode, createIndent, createNode, createRoot, createTextNode, insertBeforeNode, removeChildNode, renderer, setAttribute, setTextNodeValue, squashExportNodes, squashImportNodes, squashTextNodes, useApp, useFileManager, useIndent, useMeta, usePluginManager }; | ||
export { App, AppContext, AppContextProps, ArrowFunction, DOMElement, DOMNode, DOMNodeAttribute, ElementNames, Export, File, Fun, Function, Import, Node, NodeNames, ReactTemplate, ReactTemplateOptions, RootType, Text, TextNode, appendChildNode, createIndent, createNode, createRoot, createTextNode, getFile, insertBeforeNode, nodeNames, removeChildNode, renderer, setAttribute, setTextNodeValue, squashExportNodes, squashImportNodes, squashTextNodes, useApp, useFileManager, useIndent, useMeta, usePluginManager }; |
@@ -1,2 +0,2 @@ | ||
import { Import, Export } from '@kubb/core'; | ||
import { KubbFile } from '@kubb/core'; | ||
import { ReactNode, Key } from 'react'; | ||
@@ -11,8 +11,21 @@ | ||
}; | ||
'kubb-import': Import & { | ||
'kubb-file': { | ||
children?: ReactNode; | ||
key?: Key; | ||
baseName: string; | ||
path: string; | ||
env?: NodeJS.ProcessEnv; | ||
}; | ||
'kubb-source': { | ||
children?: ReactNode; | ||
key?: Key; | ||
path?: string; | ||
print?: boolean; | ||
}; | ||
'kubb-export': Export & { | ||
'kubb-import': KubbFile.Import & { | ||
print?: boolean; | ||
}; | ||
'kubb-export': KubbFile.Export & { | ||
print?: boolean; | ||
}; | ||
} | ||
@@ -19,0 +32,0 @@ } |
@@ -1,3 +0,3 @@ | ||
import { Import, Export } from '@kubb/core'; | ||
import { ReactNode } from 'react'; | ||
import { KubbFile, Logger } from '@kubb/core'; | ||
import { ReactNode, Key } from 'react'; | ||
@@ -9,3 +9,32 @@ type AppContextProps<Meta extends Record<string, unknown> = Record<string, unknown>> = { | ||
type ReactElementNames = 'br'; | ||
type ElementNames = ReactElementNames | 'kubb-text' | 'kubb-import' | 'kubb-export' | 'kubb-root' | 'kubb-app'; | ||
declare global { | ||
namespace JSX { | ||
interface IntrinsicElements { | ||
'kubb-text': { | ||
children?: ReactNode; | ||
key?: Key; | ||
}; | ||
'kubb-file': { | ||
children?: ReactNode; | ||
key?: Key; | ||
baseName: string; | ||
path: string; | ||
env?: NodeJS.ProcessEnv; | ||
}; | ||
'kubb-source': { | ||
children?: ReactNode; | ||
key?: Key; | ||
path?: string; | ||
print?: boolean; | ||
}; | ||
'kubb-import': KubbFile.Import & { | ||
print?: boolean; | ||
}; | ||
'kubb-export': KubbFile.Export & { | ||
print?: boolean; | ||
}; | ||
} | ||
} | ||
} | ||
type ElementNames = ReactElementNames | 'kubb-text' | 'kubb-file' | 'kubb-source' | 'kubb-import' | 'kubb-export' | 'kubb-root' | 'kubb-app'; | ||
type Node = { | ||
@@ -46,11 +75,11 @@ parentNode: DOMElement | undefined; | ||
*/ | ||
imports: Import[]; | ||
/** | ||
* Custom for Kubb | ||
*/ | ||
exports: Export[]; | ||
file?: KubbFile.File; | ||
}; | ||
declare function createRootServer<Context extends AppContextProps = AppContextProps>(container?: DOMElement): RootType<Context>; | ||
type Props = { | ||
container?: DOMElement; | ||
logger?: Logger; | ||
}; | ||
declare function createRootServer<Context extends AppContextProps = AppContextProps>({ container, logger }: Props): RootType<Context>; | ||
export { createRootServer, createRootServer as default }; | ||
export { RootType, createRootServer, createRootServer as default }; |
{ | ||
"name": "@kubb/react", | ||
"version": "1.12.0-canary.20231018T090612", | ||
"version": "1.12.0-canary.20231018T095837", | ||
"description": "Generator react", | ||
@@ -42,5 +42,2 @@ "keywords": [ | ||
}, | ||
"./globals": { | ||
"types": "./globals.d.ts" | ||
}, | ||
"./*": "./*" | ||
@@ -61,3 +58,3 @@ }, | ||
"@kubb/core": "1.11.6", | ||
"@kubb/parser": "1.11.6" | ||
"@kubb/parser": "1.12.0-canary.20231018T095824" | ||
}, | ||
@@ -72,3 +69,3 @@ "devDependencies": { | ||
"@kubb/eslint-config": "1.1.8", | ||
"@kubb/parser": "1.11.6", | ||
"@kubb/parser": "1.12.0-canary.20231018T095824", | ||
"@kubb/ts-config": "0.1.0", | ||
@@ -75,0 +72,0 @@ "@kubb/tsup-config": "1.1.8" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
16081427
156030
27
+ Added@kubb/parser@1.12.0-canary.20231018T095824(transitive)