t-getter
Version:
Library for making texts from objects
12 lines (11 loc) • 454 B
TypeScript
type Placeholder = undefined | string | Function;
interface Options {
placeholder?: Placeholder;
freeze?: boolean;
}
type Result = string | number | Function;
type TextObject = Record<string, Result | object>;
type TextPath = string;
type Texts = TextObject[] | [];
type TextFnArguments = string[] | number[];
export default function GetText(texts: Texts, { placeholder, freeze }?: Options): (prop: TextPath, ...args: TextFnArguments) => Result;