Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@chatium/json

Package Overview
Dependencies
Maintainers
2
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@chatium/json - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

6

lib/blocks/Audio.d.ts
import { CommonBlockProps } from '../commonTypes';
export interface AudioProps<ExtraActions> extends CommonBlockProps<ExtraActions> {
export interface AudioProps<ExtraBlocks, ExtraActions> extends CommonBlockProps<ExtraBlocks, ExtraActions> {
title?: string;

@@ -9,5 +9,5 @@ description?: string;

}
export interface AudioBlock<ExtraActions> extends AudioProps<ExtraActions> {
export interface AudioBlock<ExtraBlocks, ExtraActions> extends AudioProps<ExtraBlocks, ExtraActions> {
type: 'audio';
}
export declare function Audio<ExtraActions>(props: AudioProps<ExtraActions>): AudioBlock<ExtraActions>;
export declare function Audio<ExtraBlocks, ExtraActions>(props: AudioProps<ExtraBlocks, ExtraActions>): AudioBlock<ExtraBlocks, ExtraActions>;
import { ChatiumActions } from '../actions';
import { Color, CommonBlockProps, FontSize, Icon } from '../commonTypes';
export interface ButtonProps<ExtraActions> extends CommonBlockProps<ExtraActions> {
export interface ButtonProps<ExtraBlocks, ExtraActions> extends CommonBlockProps<ExtraBlocks, ExtraActions> {
bgColor?: Color;

@@ -13,5 +13,5 @@ fontColor?: Color;

}
export interface ButtonBlock<ExtraActions> extends ButtonProps<ExtraActions> {
export interface ButtonBlock<ExtraBlocks, ExtraActions> extends ButtonProps<ExtraBlocks, ExtraActions> {
type: 'button';
}
export declare function Button<ExtraActions>(props: ButtonProps<ExtraActions>): ButtonBlock<ExtraActions>;
export declare function Button<ExtraBlocks, ExtraActions>(props: ButtonProps<ExtraBlocks, ExtraActions>): ButtonBlock<ExtraBlocks, ExtraActions>;
import { CommonBlockProps } from '../commonTypes';
import { ChatiumChildNode } from '../utils/children';
import { ChatiumBlock } from './index';
export interface FooterProps<ExtraActions> extends CommonBlockProps<ExtraActions> {
blocks?: ChatiumBlock<ExtraActions>[];
export interface FooterProps<ExtraBlocks, ExtraActions> extends CommonBlockProps<ExtraBlocks, ExtraActions> {
blocks?: ChatiumBlock<ExtraBlocks, ExtraActions>[];
visibleAlways?: boolean;
}
export interface FooterBlock<ExtraActions> extends FooterProps<ExtraActions> {
export interface FooterBlock<ExtraBlocks, ExtraActions> extends FooterProps<ExtraBlocks, ExtraActions> {
type: 'footer';
}
export declare function Footer<ExtraActions>(props: FooterProps<ExtraActions>, ...children: ChatiumChildNode<ExtraActions>[]): Promise<FooterBlock<ExtraActions>>;
export declare function Footer<ExtraBlocks, ExtraActions>(props: FooterProps<ExtraBlocks, ExtraActions>, ...children: ChatiumChildNode<ExtraBlocks, ExtraActions>[]): Promise<FooterBlock<ExtraBlocks, ExtraActions>>;

@@ -5,14 +5,14 @@ import type { ChatiumActions } from '../actions';

import type { ChatiumBlock } from './index';
export declare type GalleryBlock<ExtraActions> = GalleryProps<ExtraActions> & {
export declare type GalleryBlock<ExtraBlocks, ExtraActions> = GalleryProps<ExtraBlocks, ExtraActions> & {
type: 'gallery';
};
export declare type GalleryProps<ExtraActions> = {
export declare type GalleryProps<ExtraBlocks, ExtraActions> = {
onClick?: ChatiumActions<ExtraActions>;
initialSlideIndex?: number;
slides?: Array<{
content?: ChatiumBlock<ExtraActions>;
content?: ChatiumBlock<ExtraBlocks, ExtraActions>;
} | {
blocks?: ChatiumBlock<ExtraActions>[];
blocks?: ChatiumBlock<ExtraBlocks, ExtraActions>[];
}>;
} & CommonBlockProps<ExtraActions>;
export declare function Gallery<ExtraActions>(props: GalleryProps<ExtraActions>, ...children: ChatiumChildNode<ExtraActions>[]): Promise<GalleryBlock<ExtraActions>>;
} & CommonBlockProps<ExtraBlocks, ExtraActions>;
export declare function Gallery<ExtraBlocks, ExtraActions>(props: GalleryProps<ExtraBlocks, ExtraActions>, ...children: ChatiumChildNode<ExtraBlocks, ExtraActions>[]): Promise<GalleryBlock<ExtraBlocks, ExtraActions>>;

@@ -6,4 +6,4 @@ import { ChatiumActions } from '../actions';

import { TextBlock } from './Text';
export interface HeaderProps<ExtraActions> extends WithKey {
blocks?: ChatiumBlock<ExtraActions>[];
export interface HeaderProps<ExtraBlocks, ExtraActions> extends WithKey {
blocks?: ChatiumBlock<ExtraBlocks, ExtraActions>[];
compact: boolean;

@@ -15,4 +15,4 @@ logo?: {

};
title?: TextBlock<ExtraActions>;
description?: TextBlock<ExtraActions>;
title?: TextBlock<ExtraBlocks, ExtraActions>;
description?: TextBlock<ExtraBlocks, ExtraActions>;
bottomGradientColors?: string[];

@@ -28,9 +28,9 @@ topGradientColors?: string[];

}
export interface HeaderBlock<ExtraActions> extends HeaderProps<ExtraActions> {
export interface HeaderBlock<ExtraBlocks, ExtraActions> extends HeaderProps<ExtraBlocks, ExtraActions> {
type: 'header';
}
export declare type HeaderFnProps<ExtraActions> = Omit<HeaderProps<ExtraActions>, 'title' | 'description'> & {
title?: TextBlock<ExtraActions> | Promise<TextBlock<ExtraActions>>;
description?: TextBlock<ExtraActions> | Promise<TextBlock<ExtraActions>>;
export declare type HeaderFnProps<ExtraBlocks, ExtraActions> = Omit<HeaderProps<ExtraBlocks, ExtraActions>, 'title' | 'description'> & {
title?: TextBlock<ExtraBlocks, ExtraActions> | Promise<TextBlock<ExtraBlocks, ExtraActions>>;
description?: TextBlock<ExtraBlocks, ExtraActions> | Promise<TextBlock<ExtraBlocks, ExtraActions>>;
};
export declare function Header<ExtraActions>(props: HeaderFnProps<ExtraActions>, ...children: ChatiumChildNode<ExtraActions>[]): Promise<HeaderBlock<ExtraActions>>;
export declare function Header<ExtraBlocks, ExtraActions>(props: HeaderFnProps<ExtraBlocks, ExtraActions>, ...children: ChatiumChildNode<ExtraBlocks, ExtraActions>[]): Promise<HeaderBlock<ExtraBlocks, ExtraActions>>;

@@ -13,3 +13,3 @@ import { ChatiumActions } from '../actions';

}
export interface HorizontalCardsProps<ExtraActions> extends CommonBlockProps<ExtraActions> {
export interface HorizontalCardsProps<ExtraBlocks, ExtraActions> extends CommonBlockProps<ExtraBlocks, ExtraActions> {
size: 'small' | 'medium' | 'large';

@@ -21,6 +21,6 @@ shape: 'circle' | 'square' | 'rectangleHorizontal' | 'rectangleVertical';

}
export interface HorizontalCardsBlock<ExtraActions> extends HorizontalCardsProps<ExtraActions> {
export interface HorizontalCardsBlock<ExtraBlocks, ExtraActions> extends HorizontalCardsProps<ExtraBlocks, ExtraActions> {
type: 'horizontalCards';
}
export declare function HorizontalCards<ExtraActions>(props: HorizontalCardsProps<ExtraActions>): HorizontalCardsBlock<ExtraActions>;
export declare function HorizontalCards<ExtraBlocks, ExtraActions>(props: HorizontalCardsProps<ExtraBlocks, ExtraActions>): HorizontalCardsBlock<ExtraBlocks, ExtraActions>;
export declare function Card<ExtraActions>(props: CardProps<ExtraActions>): CardProps<ExtraActions>;
import { ChatiumActions } from '../actions';
import { CommonBlockProps } from '../commonTypes';
export interface ImageProps<ExtraActions> extends CommonBlockProps<ExtraActions> {
export interface ImageProps<ExtraBlocks, ExtraActions> extends CommonBlockProps<ExtraBlocks, ExtraActions> {
downloadUrl: string;

@@ -15,5 +15,5 @@ onClick?: ChatiumActions<ExtraActions>;

}
export interface ImageBlock<ExtraActions> extends ImageProps<ExtraActions> {
export interface ImageBlock<ExtraBlocks, ExtraActions> extends ImageProps<ExtraBlocks, ExtraActions> {
type: 'image';
}
export declare function Image<ExtraActions>(props: ImageProps<ExtraActions>): ImageBlock<ExtraActions>;
export declare function Image<ExtraBlocks, ExtraActions>(props: ImageProps<ExtraBlocks, ExtraActions>): ImageBlock<ExtraBlocks, ExtraActions>;

@@ -13,2 +13,2 @@ import { Audio, AudioBlock } from './Audio';

export { Audio, Button, Footer, Gallery, Header, HorizontalCards, InlineVideo, Image, ListItem, Search, Text, Video };
export declare type ChatiumBlock<ExtraActions> = AudioBlock<ExtraActions> | ButtonBlock<ExtraActions> | FooterBlock<ExtraActions> | GalleryBlock<ExtraActions> | HeaderBlock<ExtraActions> | HorizontalCardsBlock<ExtraActions> | ImageBlock<ExtraActions> | InlineVideoBlock<ExtraActions> | ListItemBlock<ExtraActions> | SearchBlock<ExtraActions> | TextBlock<ExtraActions> | VideoBlock<ExtraActions>;
export declare type ChatiumBlock<ExtraBlocks, ExtraActions> = AudioBlock<ExtraBlocks, ExtraActions> | ButtonBlock<ExtraBlocks, ExtraActions> | FooterBlock<ExtraBlocks, ExtraActions> | GalleryBlock<ExtraBlocks, ExtraActions> | HeaderBlock<ExtraBlocks, ExtraActions> | HorizontalCardsBlock<ExtraBlocks, ExtraActions> | ImageBlock<ExtraBlocks, ExtraActions> | InlineVideoBlock<ExtraBlocks, ExtraActions> | ListItemBlock<ExtraBlocks, ExtraActions> | SearchBlock<ExtraBlocks, ExtraActions> | TextBlock<ExtraBlocks, ExtraActions> | VideoBlock<ExtraBlocks, ExtraActions> | ExtraBlocks;
import { ChatiumActions } from '../actions';
import { Color, CommonBlockProps, Icon, ImageSize, StatusIcon } from '../commonTypes';
export interface ListItemProps<ExtraActions> extends CommonBlockProps<ExtraActions> {
export interface ListItemProps<ExtraBlocks, ExtraActions> extends CommonBlockProps<ExtraBlocks, ExtraActions> {
description?: string;

@@ -19,5 +19,5 @@ image?: string;

}
export interface ListItemBlock<ExtraActions> extends ListItemProps<ExtraActions> {
export interface ListItemBlock<ExtraBlocks, ExtraActions> extends ListItemProps<ExtraBlocks, ExtraActions> {
type: 'screen';
}
export declare function ListItem<ExtraActions>(props: ListItemProps<ExtraActions>): ListItemBlock<ExtraActions>;
export declare function ListItem<ExtraBlocks, ExtraActions>(props: ListItemProps<ExtraBlocks, ExtraActions>): ListItemBlock<ExtraBlocks, ExtraActions>;
import { Color, CommonBlockProps, Icon } from '../commonTypes';
export interface SearchProps<ExtraActions> extends CommonBlockProps<ExtraActions> {
export interface SearchProps<ExtraBlocks, ExtraActions> extends CommonBlockProps<ExtraBlocks, ExtraActions> {
bgColor?: Color;

@@ -15,5 +15,5 @@ borderColor?: Color;

}
export interface SearchBlock<ExtraActions> extends SearchProps<ExtraActions> {
export interface SearchBlock<ExtraBlocks, ExtraActions> extends SearchProps<ExtraBlocks, ExtraActions> {
type: 'search';
}
export declare function Search<ExtraActions>(props: SearchProps<ExtraActions>): SearchBlock<ExtraActions>;
export declare function Search<ExtraBlocks, ExtraActions>(props: SearchProps<ExtraBlocks, ExtraActions>): SearchBlock<ExtraBlocks, ExtraActions>;

@@ -5,5 +5,5 @@ import { ChatiumActions } from '../actions';

import { ChatiumBlock } from './index';
export declare type TextBlock<ExtraActions> = TextProps<ExtraActions> & {
export declare type TextBlock<ExtraBlocks, ExtraActions> = TextProps<ExtraBlocks, ExtraActions> & {
type: 'text';
blocks?: ChatiumBlock<ExtraActions>[];
blocks?: ChatiumBlock<ExtraBlocks, ExtraActions>[];
};

@@ -17,5 +17,5 @@ export declare type TextStyle = {

};
export declare type TextProps<ExtraActions> = {
export declare type TextProps<ExtraBlocks, ExtraActions> = {
onClick?: ChatiumActions<ExtraActions>;
} & TextContent<ExtraActions> & CommonBlockProps<ExtraActions> & TextStyle;
} & TextContent<ExtraActions> & CommonBlockProps<ExtraBlocks, ExtraActions> & TextStyle;
export declare type TextContent<ExtraActions> = {

@@ -34,3 +34,3 @@ text: string;

}
export declare function Text<ExtraActions>(props: TextProps<ExtraActions>, ...children: ChatiumChildNode<ExtraActions>[]): Promise<TextBlock<ExtraActions>>;
export declare function Text<ExtraBlocks, ExtraActions>(props: TextProps<ExtraBlocks, ExtraActions>, ...children: ChatiumChildNode<ExtraBlocks, ExtraActions>[]): Promise<TextBlock<ExtraBlocks, ExtraActions>>;
export {};
import { ChatiumActions } from '../actions';
import { CommonBlockProps, OverlayProps } from '../commonTypes';
interface CommonVideoProps<ExtraActions> extends CommonBlockProps<ExtraActions> {
interface CommonVideoProps<ExtraBlocks, ExtraActions> extends CommonBlockProps<ExtraBlocks, ExtraActions> {
hlsUrl?: string;

@@ -9,3 +9,3 @@ imageUrl?: string;

}
export interface VideoProps<ExtraActions> extends CommonVideoProps<ExtraActions> {
export interface VideoProps<ExtraBlocks, ExtraActions> extends CommonVideoProps<ExtraBlocks, ExtraActions> {
url?: string;

@@ -16,11 +16,11 @@ file?: {

}
export interface VideoBlock<ExtraActions> extends VideoProps<ExtraActions> {
export interface VideoBlock<ExtraBlocks, ExtraActions> extends VideoProps<ExtraBlocks, ExtraActions> {
type: 'video';
}
export declare function Video<ExtraActions>(props: VideoProps<ExtraActions>): VideoBlock<ExtraActions>;
export interface InlineVideoProps<ExtraActions> extends CommonVideoProps<ExtraActions> {
export declare function Video<ExtraBlocks, ExtraActions>(props: VideoProps<ExtraBlocks, ExtraActions>): VideoBlock<ExtraBlocks, ExtraActions>;
export interface InlineVideoProps<ExtraBlocks, ExtraActions> extends CommonVideoProps<ExtraBlocks, ExtraActions> {
ignoreSilentSwitch?: 'ignore' | 'obey';
muted?: boolean;
onProgressChange?: ProgressChangeProps<ExtraActions>[];
overlay?: OverlayProps<ExtraActions>;
overlay?: OverlayProps<ExtraBlocks, ExtraActions>;
onVideoEnd?: ChatiumActions<ExtraActions>;

@@ -45,6 +45,6 @@ paused?: boolean;

}
export interface InlineVideoBlock<ExtraActions> extends InlineVideoProps<ExtraActions> {
export interface InlineVideoBlock<ExtraBlocks, ExtraActions> extends InlineVideoProps<ExtraBlocks, ExtraActions> {
type: 'inlineVideo';
}
export declare function InlineVideo<ExtraActions>(props: InlineVideoProps<ExtraActions>): InlineVideoBlock<ExtraActions>;
export declare function InlineVideo<ExtraBlocks, ExtraActions>(props: InlineVideoProps<ExtraBlocks, ExtraActions>): InlineVideoBlock<ExtraBlocks, ExtraActions>;
export {};

@@ -6,13 +6,13 @@ import { ChatiumActions } from './actions';

*/
export declare type ChatiumResponse<ExtraActions> = ChatiumSuccessResponse<ExtraActions> | ErrorResponse<ExtraActions>;
declare type ChatiumSuccessResponse<ExtraActions> = {
export declare type ChatiumResponse<ExtraBlocks, ExtraActions> = ChatiumSuccessResponse<ExtraBlocks, ExtraActions> | ErrorResponse<ExtraBlocks, ExtraActions>;
declare type ChatiumSuccessResponse<ExtraBlocks, ExtraActions> = {
success: true;
} & (ScreenResponse<ExtraActions> | ApiCallResponse<ExtraActions> | DataResponse);
declare type ErrorResponse<ExtraActions> = ScreenErrorResponse<ExtraActions> | ApiCallErrorResponse<ExtraActions> | DataErrorResponse;
} & (ScreenResponse<ExtraBlocks, ExtraActions> | ApiCallResponse<ExtraBlocks, ExtraActions> | DataResponse);
declare type ErrorResponse<ExtraBlocks, ExtraActions> = ScreenErrorResponse<ExtraBlocks, ExtraActions> | ApiCallErrorResponse<ExtraBlocks, ExtraActions> | DataErrorResponse;
/**
* Standard response for apiCall client action
*/
export interface ApiCallResponse<ExtraActions> {
export interface ApiCallResponse<ExtraBlocks, ExtraActions> {
appAction?: ChatiumActions<ExtraActions>;
appScreens?: Record<string, ChatiumScreen<ExtraActions>>;
appScreens?: Record<string, ChatiumScreen<ExtraBlocks, ExtraActions>>;
}

@@ -28,5 +28,5 @@ /**

*/
export interface ScreenResponse<ExtraActions> {
data: ChatiumScreen<ExtraActions>;
appScreens?: Record<string, ChatiumScreen<ExtraActions>>;
export interface ScreenResponse<ExtraBlocks, ExtraActions> {
data: ChatiumScreen<ExtraBlocks, ExtraActions>;
appScreens?: Record<string, ChatiumScreen<ExtraBlocks, ExtraActions>>;
preloadMedia?: string[];

@@ -47,5 +47,5 @@ }

}
export interface ScreenErrorResponse<ExtraActions> extends ChatiumErrorResponse, Partial<ScreenResponse<ExtraActions>> {
export interface ScreenErrorResponse<ExtraBlocks, ExtraActions> extends ChatiumErrorResponse, Partial<ScreenResponse<ExtraBlocks, ExtraActions>> {
}
export interface ApiCallErrorResponse<ExtraActions> extends ChatiumErrorResponse, ApiCallResponse<ExtraActions> {
export interface ApiCallErrorResponse<ExtraBlocks, ExtraActions> extends ChatiumErrorResponse, ApiCallResponse<ExtraBlocks, ExtraActions> {
}

@@ -52,0 +52,0 @@ export interface DataErrorResponse extends ChatiumErrorResponse, Partial<DataResponse> {

import type { ChatiumActions } from './actions';
import type { ChatiumBlock } from './blocks';
export interface CommonBlockProps<ExtraActions> extends WithKey {
export interface CommonBlockProps<ExtraBlocks, ExtraActions> extends WithKey {
containerStyle?: ContainerStyle | null;
fallback?: ChatiumBlock<ExtraActions>;
fallback?: ChatiumBlock<ExtraBlocks, ExtraActions>;
onContext?: ChatiumActions<ExtraActions>;

@@ -82,8 +82,8 @@ }

declare type FlexAlignType = 'flex-start' | 'flex-end' | 'center' | 'stretch' | 'baseline';
export interface OverlayProps<ExtraActions> {
export interface OverlayProps<ExtraBlocks, ExtraActions> {
id?: ChatiumJsonId;
gradientColors?: string[];
blocks: ChatiumBlock<ExtraActions>[];
blocks: ChatiumBlock<ExtraBlocks, ExtraActions>[];
containerStyle?: ContainerStyle;
}
export {};

@@ -27,16 +27,16 @@ import { Audio, AudioProps } from './blocks/Audio';

*/
export interface ChatiumIntrinsicElements<ExtraActions> {
audio: AudioProps<ExtraActions>;
button: ButtonProps<ExtraActions>;
export interface ChatiumIntrinsicElements<ExtraBlocks, ExtraActions> {
audio: AudioProps<ExtraBlocks, ExtraActions>;
button: ButtonProps<ExtraBlocks, ExtraActions>;
f: {};
footer: FooterProps<ExtraActions>;
gallery: GalleryProps<ExtraActions>;
header: HeaderProps<ExtraActions>;
image: ImageProps<ExtraActions>;
'list-item': ListItemProps<ExtraActions>;
'horizontal-cards': HorizontalCardsProps<ExtraActions>;
screen: ScreenProps<ExtraActions>;
search: SearchProps<ExtraActions>;
text: TextProps<ExtraActions>;
video: VideoProps<ExtraActions>;
footer: FooterProps<ExtraBlocks, ExtraActions>;
gallery: GalleryProps<ExtraBlocks, ExtraActions>;
header: HeaderProps<ExtraBlocks, ExtraActions>;
image: ImageProps<ExtraBlocks, ExtraActions>;
'list-item': ListItemProps<ExtraBlocks, ExtraActions>;
'horizontal-cards': HorizontalCardsProps<ExtraBlocks, ExtraActions>;
screen: ScreenProps<ExtraBlocks, ExtraActions>;
search: SearchProps<ExtraBlocks, ExtraActions>;
text: TextProps<ExtraBlocks, ExtraActions>;
video: VideoProps<ExtraBlocks, ExtraActions>;
}

@@ -43,0 +43,0 @@ export declare const intrinsicBlocks: {

@@ -11,20 +11,20 @@ import type { ChatiumActions } from './actions';

import { ChatiumChildNode } from './utils/children';
export interface ChatiumScreen<ExtraActions> {
export interface ChatiumScreen<ExtraBlocks, ExtraActions> {
title: string;
description?: string;
backUrl?: string;
header?: HeaderProps<ExtraActions>;
headerButton?: HeaderButton<ExtraActions>;
headerLeftButton?: HeaderButton<ExtraActions>;
header?: HeaderProps<ExtraBlocks, ExtraActions>;
headerButton?: HeaderButton<ExtraBlocks, ExtraActions>;
headerLeftButton?: HeaderButton<ExtraBlocks, ExtraActions>;
contextLinks?: ContextLink<ExtraActions>[];
socketId?: string;
socketIds?: string[];
blocks?: ChatiumBlock<ExtraActions>[];
dropdownMenuBlocks?: ChatiumBlock<ExtraActions>[];
blocks?: ChatiumBlock<ExtraBlocks, ExtraActions>[];
dropdownMenuBlocks?: ChatiumBlock<ExtraBlocks, ExtraActions>[];
dropdownMenuInitiallyVisible?: boolean;
pinnedBlocks?: ChatiumBlock<ExtraActions>[];
pinnedBlocks?: ChatiumBlock<ExtraBlocks, ExtraActions>[];
chat?: ChatProps<ExtraActions>;
fullScreenGallery?: GalleryProps<ExtraActions>;
footer?: FooterProps<ExtraActions>;
search?: SearchProps<ExtraActions>;
fullScreenGallery?: GalleryProps<ExtraBlocks, ExtraActions>;
footer?: FooterProps<ExtraBlocks, ExtraActions>;
search?: SearchProps<ExtraBlocks, ExtraActions>;
needEmailCheck?: boolean;

@@ -37,3 +37,3 @@ needPhoneCheck?: boolean;

}
export declare type HeaderButton<ExtraActions> = Pick<ButtonProps<ExtraActions>, 'icon' | 'onClick'>;
export declare type HeaderButton<ExtraBlocks, ExtraActions> = Pick<ButtonProps<ExtraBlocks, ExtraActions>, 'icon' | 'onClick'>;
export interface ContextLink<ExtraActions> {

@@ -44,5 +44,5 @@ title: string;

}
export declare type ScreenProps<ExtraActions> = Omit<ChatiumScreen<ExtraActions>, 'blocks' | 'search' | 'headerButton' | 'pinnedBlocks' | 'backUrl'> & {
headerButton?: HeaderButton<ExtraActions> | Promise<HeaderButton<ExtraActions>>;
pinnedBlocks?: ChatiumBlock<ExtraActions>[] | Promise<ChatiumBlock<ExtraActions>[]>;
export declare type ScreenProps<ExtraBlocks, ExtraActions> = Omit<ChatiumScreen<ExtraBlocks, ExtraActions>, 'blocks' | 'search' | 'headerButton' | 'pinnedBlocks' | 'backUrl'> & {
headerButton?: HeaderButton<ExtraBlocks, ExtraActions> | Promise<HeaderButton<ExtraBlocks, ExtraActions>>;
pinnedBlocks?: ChatiumBlock<ExtraBlocks, ExtraActions>[] | Promise<ChatiumBlock<ExtraBlocks, ExtraActions>[]>;
backUrl?: string | Promise<string>;

@@ -55,2 +55,2 @@ };

*/
export declare function Screen<ExtraActions>(props: ScreenProps<ExtraActions>, ...children: ChatiumChildNode<ExtraActions>[]): Promise<ChatiumScreen<ExtraActions>>;
export declare function Screen<ExtraBlocks, ExtraActions>(props: ScreenProps<ExtraBlocks, ExtraActions>, ...children: ChatiumChildNode<ExtraBlocks, ExtraActions>[]): Promise<ChatiumScreen<ExtraBlocks, ExtraActions>>;
import { ChatiumBlock } from '../blocks';
export declare function flattenChildren<ExtraActions>(children: ChatiumChildNode<ExtraActions>[]): Promise<ChatiumBlock<ExtraActions>[]>;
export declare type ChatiumChildNode<ExtraActions> = SyncNode<ExtraActions> | Promise<SyncNode<ExtraActions>>;
declare type SyncNode<ExtraActions> = SingleNode<ExtraActions> | SingleNode<ExtraActions>[];
declare type SingleNode<ExtraActions> = ChatiumBlock<ExtraActions> | null | undefined | false | 0 | '';
export declare function flattenChildren<ExtraBlocks, ExtraActions>(children: ChatiumChildNode<ExtraBlocks, ExtraActions>[]): Promise<ChatiumBlock<ExtraBlocks, ExtraActions>[]>;
export declare type ChatiumChildNode<ExtraBlocks, ExtraActions> = SyncNode<ExtraBlocks, ExtraActions> | Promise<SyncNode<ExtraBlocks, ExtraActions>>;
declare type SyncNode<ExtraBlocks, ExtraActions> = SingleNode<ExtraBlocks, ExtraActions> | SingleNode<ExtraBlocks, ExtraActions>[];
declare type SingleNode<ExtraBlocks, ExtraActions> = ChatiumBlock<ExtraBlocks, ExtraActions> | null | undefined | false | 0 | '';
export {};

@@ -6,2 +6,2 @@ import { ChatiumChildNode } from './children';

*/
export declare function Fragment<ExtraActions>(_props?: {}, ...children: ChatiumChildNode<ExtraActions>[]): ChatiumChildNode<ExtraActions>[];
export declare function Fragment<ExtraBlocks, ExtraActions>(_props?: {}, ...children: ChatiumChildNode<ExtraBlocks, ExtraActions>[]): ChatiumChildNode<ExtraBlocks, ExtraActions>[];

@@ -6,3 +6,3 @@ import { ChatiumScreen } from '../Screen';

*/
export declare function jsxFactory<IE extends Record<string, object>, K extends keyof IE, ExtraActions>(intrinsicBlocks: Record<K, BlockFactory<ExtraActions, IE[K]>>): <P>(block: K | BlockFactory<ExtraActions, P>, props: IE[K] | P, ...children: ChatiumChildNode<ExtraActions>[]) => JsxNode<ExtraActions>;
export declare function jsxFactory<IE extends Record<string, object>, K extends keyof IE, ExtraBlocks, ExtraActions>(intrinsicBlocks: Record<K, BlockFactory<ExtraBlocks, ExtraActions, IE[K]>>): <P>(block: K | BlockFactory<ExtraBlocks, ExtraActions, P>, props: IE[K] | P, ...children: ChatiumChildNode<ExtraBlocks, ExtraActions>[]) => JsxNode<ExtraBlocks, ExtraActions>;
/**

@@ -17,7 +17,7 @@ * Custom JSX factory for the chatium-json blocks.

*/
export declare const jsx: <P>(block: string | BlockFactory<unknown, P>, props: object | P, ...children: ChatiumChildNode<unknown>[]) => JsxNode<unknown>;
interface BlockFactory<ExtraActions, P = {}> {
(props: P, ...children: ChatiumChildNode<ExtraActions>[]): JsxNode<ExtraActions>;
export declare const jsx: <P>(block: string | BlockFactory<unknown, unknown, P>, props: object | P, ...children: unknown[]) => unknown;
interface BlockFactory<ExtraBlocks, ExtraActions, P = {}> {
(props: P, ...children: ChatiumChildNode<ExtraBlocks, ExtraActions>[]): JsxNode<ExtraBlocks, ExtraActions>;
}
declare type JsxNode<ExtraActions> = ChatiumChildNode<ExtraActions> | ChatiumChildNode<ExtraActions>[] | Promise<ChatiumScreen<ExtraActions>>;
declare type JsxNode<ExtraBlocks, ExtraActions> = ChatiumChildNode<ExtraBlocks, ExtraActions> | ChatiumChildNode<ExtraBlocks, ExtraActions>[] | Promise<ChatiumScreen<ExtraBlocks, ExtraActions>>;
export {};
{
"name": "@chatium/json",
"version": "0.0.2",
"version": "0.0.3",
"description": "Chatium-JSON UI browser format specification and reference implementation for JS/TS",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc