hellonevaehworld-sdk
Version:
Universal Hello World SDK for web and mobile applications
90 lines (87 loc) • 2.98 kB
TypeScript
interface HelloWorldConfig {
greeting?: string;
subtitle?: string;
theme?: 'light' | 'dark';
language?: 'en' | 'zh';
}
interface HelloWorldStyles {
container?: string;
title?: string;
subtitle?: string;
}
declare class HelloWorldSDK {
private config;
constructor(config?: HelloWorldConfig);
getTextContent(): {
greeting: string;
subtitle: string;
};
getThemeStyles(): {
readonly background: "linear-gradient(135deg, #667eea 0%, #764ba2 100%)";
readonly textColor: "#ffffff";
readonly shadowColor: "rgba(0, 0, 0, 0.3)";
} | {
readonly background: "linear-gradient(135deg, #2c3e50 0%, #34495e 100%)";
readonly textColor: "#ecf0f1";
readonly shadowColor: "rgba(0, 0, 0, 0.5)";
};
getInlineStyles(): {
container: {
display: string;
flexDirection: "column";
alignItems: string;
justifyContent: string;
minHeight: number;
padding: number;
background: "linear-gradient(135deg, #667eea 0%, #764ba2 100%)" | "linear-gradient(135deg, #2c3e50 0%, #34495e 100%)";
borderRadius: number;
shadowColor: "rgba(0, 0, 0, 0.3)" | "rgba(0, 0, 0, 0.5)";
shadowOffset: {
width: number;
height: number;
};
shadowOpacity: number;
shadowRadius: number;
elevation: number;
};
title: {
fontSize: number;
fontWeight: "bold";
color: "#ffffff" | "#ecf0f1";
margin: number;
marginBottom: number;
textShadowColor: "rgba(0, 0, 0, 0.3)" | "rgba(0, 0, 0, 0.5)";
textShadowOffset: {
width: number;
height: number;
};
textShadowRadius: number;
textAlign: "center";
};
subtitle: {
fontSize: number;
color: "#ffffff" | "#ecf0f1";
margin: number;
textAlign: "center";
maxWidth: number;
opacity: number;
};
};
getCSSStyles(): string;
generateHTML(): string;
updateConfig(newConfig: Partial<HelloWorldConfig>): void;
getConfig(): Readonly<Required<HelloWorldConfig>>;
}
declare const utils: {
isWeb: () => boolean;
isReactNative: () => boolean;
injectStyles: (css: string) => void;
renderToDOM: (sdk: HelloWorldSDK, containerId: string) => void;
};
declare const createReactComponent: (sdk: HelloWorldSDK) => (props: {
style?: any;
}) => any;
declare const createHelloWorld: (config?: HelloWorldConfig) => HelloWorldSDK;
declare const renderHelloWorld: (containerId: string, config?: HelloWorldConfig) => void;
export { HelloWorldSDK, createHelloWorld, createReactComponent, HelloWorldSDK as default, renderHelloWorld, utils };
export type { HelloWorldConfig, HelloWorldStyles };