UNPKG

vegan-ipsum

Version:

Generates passages of vegan-themed placeholder text suitable for use in web pages, graphics, and more. Works in the browser, NodeJS, and React Native.

42 lines (41 loc) 1.5 kB
/** * Retrieves the current process platform. * * @returns {string} The process platform (e.g., "darwin", "win32", "linux"). * * @throws {Error} If the platform cannot be determined. */ declare const getPlatform: () => string; /** * Checks if the given platform is supported. * * @param {string} platform - The process platform (e.g., "darwin", "win32", "linux"). * * @returns {boolean} `true` if the platform is supported, otherwise `false`. */ declare const isSupportedPlatform: (platform: string) => boolean; /** * Retrieves the appropriate copy command for the specified platform. * * @param {string} platform - The process platform (e.g., "darwin", "win32", "linux"). * * @returns {string} The copy command for the specified platform. */ declare const getCopyCommand: (platform?: string) => string; /** * Copies the provided text to the clipboard using the platform's native command. * * @param {string} text - The text to copy to the clipboard. * * @returns {Promise<string>} A promise that resolves with the copied text, or rejects with an error. * * @throws {Error} If the platform is not supported or if the copy command fails. */ declare const copyToClipboard: (text: string) => Promise<string>; /** * Retrieves the current version of the package. * * @returns {string} The version of the package as defined in `package.json`. */ declare const getVersion: () => string; export { copyToClipboard, getCopyCommand, getPlatform, getVersion, isSupportedPlatform };