demotivator
Version:
A TypeScript library containing 500+ hand-curated insults organized into themed packs, along with utilities to generate, search, and transform them.
53 lines • 2.23 kB
TypeScript
/**
* @license
* Copyright 2024, PorkyProductions, and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { type Insult, type InsultPackInfo, type InsultPackKey, type InsultSearchResult } from './typings';
/**
* Masks profane words in an insult using a caller-selected symbol.
* @param insult The insult string to purify.
* @param symbol Replacement symbol. Defaults to `*`.
* @returns The purified insult.
* @since 15.0.0
*/
export declare const purify: (insult: Insult, symbol?: string) => Insult;
/**
* Finds the first pack containing an insult.
* Overloads:
* - `packInfo(insult)`
* - `packInfo(position, array?)`
* - `packInfo(searchResult, array?)`
* @since 15.1.0
*/
export declare function packInfo(insult: Insult): InsultPackInfo<InsultPackKey>;
export declare function packInfo(position: number, array?: Insult[]): InsultPackInfo<InsultPackKey>;
export declare function packInfo(searchResult: InsultSearchResult, array?: Insult[]): InsultPackInfo<InsultPackKey>;
/**
* Inserts "Porky" into random positions in an insult.
* @param insult The insult string to modify.
* @param amount Number of times to insert "Porky". Defaults to `1`.
* @returns The porkified insult.
* @since 15.0.0
*/
export declare const porkify: (insult: Insult, amount?: number) => Insult;
/**
* Uppercases an insult, removes ending punctuation, and appends exclamation marks.
* @param insult The insult string to transform.
* @param exclamationCount Number of trailing exclamation marks. Defaults to `3`.
* @returns The angry version of the insult.
* @since 15.0.0
*/
export declare const makeAngry: (insult: Insult, exclamationCount?: number) => Insult;
//# sourceMappingURL=texttools.d.ts.map