import type { CodeSnippet } from './collection'; import type { TransactionOverrides } from './execution/types'; export interface FunctionConfiguration { address: string; fragment: EthersTypes.JsonFragment; } export interface WidgetConfiguration { collectionURI: string; /** * Array of `.function.` or code snippets. * For each supported language, there must be at most one code snippet. * When an array of strings is passed, they will be executed in order. * When an array of code snippets is passed, the snippet for the language * specified will be executed. */ execution?: WidgetExecutionConfiguration; } export type WidgetExecutionConfiguration = string[] | CodeSnippet[]; interface FragmentDisplayDataEntry { baseType: string; indent: number; index: number; name: string; path: string; length?: number; arrayPath?: string; arrayIndex?: number; indexInArray?: number; } export interface Theme { bonadocsBackground?: string; bonadocsText?: string; bonadocsSecondaryText?: string; bonadocsSecondaryBg?: string; bonadocsTextTertiary?: string; bonadocsTertiaryBg?: string; bonadocsStateText?: string; bonadocsButtonBg?: string; bonadocsBorderColor?: string; bonadocsCodePrimary?: string; bonadocsCodeSecondary?: string; bonadocsCodeTertiary?: string; bonadocsFooterBg?: string; bonadocsCircleBg?: string; bonadocsSuccessBg?: string; bonadocsErrorBg?: string; bonadocsSuccessCircleBg?: string; bonadocsDeleteColor?: string; bonadocsStatusBg?: string; bonadocsCode?: string; bonadocsLogo?: string; } export interface BonadocsWidgetParamProps { name: string; type: string; overrideKey: keyof TransactionOverrides; } type CommonWidgetProps = { docText?: string; theme?: ThemeMode; actionName?: string; lightTheme?: Theme; darkTheme?: Theme; }; type CollectionWidgetProps = { widgetConfigUri: string; contract?: string; functionKey?: string; }; type SingleFunctionWidgetProps = { deploymentAddresses: Map; functionSignature: string | EthersTypes.JsonFragment; }; export type BonadocsWidgetProps = CommonWidgetProps & (CollectionWidgetProps | SingleFunctionWidgetProps); export declare function isCollectionWidgetProps(props: BonadocsWidgetProps): props is CollectionWidgetProps; export type FragmentDisplayData = FragmentDisplayDataEntry[]; type SimpleContractParamValue = string | boolean | EthersTypes.BigNumberish; type ThemeMode = 'light' | 'dark'; export type ContractParamValue = SimpleContractParamValue | ContractParam; export type ContractParam = Array; export {};