@builder.io/mitosis
Version:
Write components once, run everywhere. Compiles to Vue, React, Solid, and Liquid. Import code from Figma and Builder.io
43 lines (42 loc) • 1.83 kB
TypeScript
import { MitosisComponent } from '../../types/mitosis-component';
import { MitosisNode } from '../../types/mitosis-node';
import { ToSwiftOptions } from './types';
export declare const convertConsoleLogToPrint: (code: string) => string;
export declare const ensureSwiftStringFormat: (code: string) => string;
export declare const stripStateAndProps: ({ json, options, }: {
json: MitosisComponent;
options: ToSwiftOptions;
}) => (code: string) => string;
export declare const getSwiftType: (type: string | undefined) => string;
export declare const jsxElementToSwiftUIView: (tagName: string) => string;
export declare const cssToSwiftUIModifiers: (style: Record<string, string>) => string[];
export declare const getStatePropertyTypeAnnotation: (propertyType: string | undefined, type: string | undefined) => string;
export declare const getEventHandlerName: (eventName: string) => string;
export declare const needsScrollView: (json: MitosisNode) => boolean;
export declare const isForEachBlock: (json: MitosisNode) => boolean;
export declare const getForEachParams: (json: MitosisNode, processCode: (code: string) => string) => {
collection: string;
itemName: string;
indexName: string | null;
};
export declare const camelToSnakeCase: (str: string) => string;
export declare const getBindingType: (key: string) => string;
/**
* Extract function signature information from JavaScript function code
*/
export declare const extractFunctionSignature: (code: string) => {
name: string;
params: {
name: string;
type: string;
}[];
returnType: string;
body: string;
};
/**
* Convert JavaScript function code to Swift function syntax
*/
export declare const convertJsFunctionToSwift: (code: string, functionName?: string) => {
swiftCode: string;
signature: string;
};