diff --git a/package.json b/package.json index af7102a2..3659ca77 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "css-loader": "6.7.3", "css-minimizer-webpack-plugin": "^4.2.2", "dotenv": "16.0.3", - "eslint-plugin-nullstack": "0.0.12", + "eslint-plugin-nullstack": "0.0.26", "express": "4.18.2", "fs-extra": "11.1.0", "lightningcss": "^1.19.0", diff --git a/types/ClientContext.d.ts b/types/ClientContext.d.ts index f780bb89..ea3f62a6 100644 --- a/types/ClientContext.d.ts +++ b/types/ClientContext.d.ts @@ -1,5 +1,5 @@ import { NullstackEnvironment } from './Environment' -import { NullstackNode } from './JSX' +import { NullstackFragment } from './JSX' import { NullstackPage } from './Page' import { NullstackParams } from './Params' import { NullstackProject } from './Project' @@ -98,7 +98,7 @@ export type NullstackClientContext = TProps & { * * @see https://nullstack.app/renderable-components#components-with-children */ - children: NullstackNode + children: NullstackFragment /** * Bind object. diff --git a/types/JSX.d.ts b/types/JSX.d.ts index c8bcc4fd..8995bee4 100644 --- a/types/JSX.d.ts +++ b/types/JSX.d.ts @@ -577,10 +577,14 @@ type AriaRole = | 'treeitem' | (string & {}) +type Falsy = false | 0 | '' | null | undefined +type CssClass = string | Falsy | Array +type CssStyle = string | Falsy | Array + export interface HTMLAttributes extends AriaAttributes, DOMAttributes { // Standard HTML Attributes accesskey?: string - class?: string | string[] + class?: CssClass contenteditable?: Booleanish | 'inherit' contextmenu?: string dir?: string @@ -591,7 +595,7 @@ export interface HTMLAttributes extends AriaAttributes, DOMAttributes { placeholder?: string slot?: string spellcheck?: Booleanish - style?: string + style?: CssStyle tabindex?: number | string title?: string translate?: 'yes' | 'no' @@ -1188,7 +1192,7 @@ export interface VideoHTMLAttributes extends MediaHTMLAttributes { // - union of string literals export interface SVGAttributes extends AriaAttributes, DOMAttributes { // Attributes which also defined in HTMLAttributes - class?: string | string[] + class?: CssClass color?: string height?: number | string id?: string @@ -1198,7 +1202,7 @@ export interface SVGAttributes extends AriaAttributes, DOMAttributes { method?: string min?: number | string name?: string - style?: string + style?: CssStyle target?: string type?: string width?: number | string @@ -1426,5 +1430,9 @@ declare global { } interface IntrinsicElements extends ExoticElements, AllElements {} + + interface ElementChildrenAttribute { + children: NullstackNode + } } }