aurinn-train-content-generator
Version:
A custom fork of the fantasy-name-content-generator specifically for Aurinn Train, a custom D&D campaign format.
65 lines (64 loc) • 2.5 kB
TypeScript
import { IGender } from "../interfaces/interfaces";
export declare let FantasyContentGeneratorSeed: any;
/**
* pick 1 unique values from an array, and return that value
*
* @param {any[]} array an array of values to pick from
*/
export declare const pick: (array: any[]) => any;
/**
* pick 1 or more unique values from an array, and return a new array of those picked values
*
* @param {any[]} array an array of values to pick from
* @param {number} count how many unique array values to pick out
*/
export declare const pickMany: (array: any, count?: number) => any[];
export declare const randomRace: () => void;
export declare const randomGender: () => IGender;
/**
* parse our special template syntax
*
* handles multiple "kinds" of template syntax
*
* a string containing '{alpha/beta}' will choose one at random
*
* a string starting with a $ symbol is a reference for any passed content
* so '{$colour}' becomes 'blue' if `content` was passed as { colour: 'blue' }
*
* a string container using the linked format (symbol, double colon) e.g {X::aplha/beta}
* will ensure that any other placeholder in the string that uses the same linked symbol
* returns the same index of random that the first placeholder with that symbol did
*
* @param {string} string
*/
export declare const parseTemplate: (string: string, content?: {}) => string;
/**
* generate a random number between 2 inclusive values
*
* @param {number} min minimum number to return (inclusive)
* @param {number} max maximum number to return (inclusive)
* @param {any} seed
*/
export declare const rand: (min: any, max: any) => any;
/**
*
* @param {number} number
* @param {function} func
*/
export declare const forCount: (number: any, func: any) => void;
export declare const titleCase: (string: any) => any;
export declare const firstCharacterUppercase: (string: any) => any;
export declare const formatString: (str: any) => any;
export declare const generateUUID: () => string;
export declare const withSeed: (seed: any, callback: any) => any;
declare const functions: {
pick: (array: any[]) => any;
withSeed: (seed: any, callback: any) => any;
formatString: (str: any) => any;
pickMany: (array: any, count?: number) => any[];
randomRace: () => void;
randomGender: () => IGender;
parseTemplate: (string: string, content?: {}) => string;
titleCase: (string: any) => any;
};
export default functions;