@prismicio/mock
Version:
Generate mock Prismic documents, fields, Slices, and models for development and testing environments
50 lines (49 loc) • 1.93 kB
TypeScript
/**
* The following code is a modified version of fast-lorem-ipsum from Amit Gupta.
* The changes are made to support starting the return value from a configurable
* word offset.
*
* https://github.com/amitguptagwl/fast-lorem-ipsum/tree/7f836ee59a23cc75e7ca5b1a1747ea888eab31c7
*
* MIT License
*
* Copyright (c) 2017 Amit Gupta
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
export declare const loremWords: string[];
/**
* Returns "Lorem ipsum" text of a specified length.
*
* @example
*
* ```ts
* lorem("100w"); // 100 words
* lorem("200c"); // 200 characters
* ```
*
* @param length - Length of the returned text in the form of `${number}w` or
* `${number}c`. `w` means words, `c` means characters.
*
* @returns Lorem ipsum text.
*/
export declare const lorem: {
(length: `${number}w` | `${number}c`, wordOffset?: number): string;
spaceIndices: number[];
};