namespace formgen.conf { /** */ export type type_data = { zerez : { fake : boolean; base_url : string; token_url : string; scope : string; client_id : string; client_secret : string; }; }; /** */ var _data : (null | type_data) = null; /** */ export async function initialize( path : string ) : Promise { const content : string = await formgen.helpers.file.read_text(path); const data : type_data = (formgen.helpers.json.decode(content) as type_data); _data = data; } /** * @todo sanitize */ export function get( ) : type_data { if (_data === null) { throw (new Error("not initialized")); } else { return _data; } } }