mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-31 19:12:20 +08:00
Merge pull request #25901 from AndersonFriaca/jquery-slugify
Types for JQuery Slugify
This commit is contained in:
33
types/jquery-slugify/index.d.ts
vendored
Normal file
33
types/jquery-slugify/index.d.ts
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
// Type definitions for jquery-slugify 1.2
|
||||
// Project: https://github.com/madflow/jquery-slugify
|
||||
// Definitions by: Anderson Friaça <https://github.com/AndersonFriaca>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
/// <reference types="jquery" />
|
||||
|
||||
export type Options = Partial<{
|
||||
preSlug: ((source: string) => string);
|
||||
postSlug: ((source: string) => string);
|
||||
slugFunc: ((input: string, options: Options) => string);
|
||||
separator: string;
|
||||
lang: string | boolean;
|
||||
symbols: boolean;
|
||||
maintainCase: boolean;
|
||||
titleCase: string[] | boolean;
|
||||
truncate: number;
|
||||
uric: boolean;
|
||||
uricNoSlash: boolean;
|
||||
mark: boolean;
|
||||
custom: string[];
|
||||
}>;
|
||||
|
||||
declare global {
|
||||
interface JQuery {
|
||||
slugify(source: string, options?: Options): JQuery;
|
||||
}
|
||||
|
||||
interface JQueryStatic {
|
||||
slugify(source: string, options?: Options): string;
|
||||
}
|
||||
}
|
||||
7
types/jquery-slugify/jquery-slugify-tests.ts
Normal file
7
types/jquery-slugify/jquery-slugify-tests.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
$.slugify("jquery slugify");
|
||||
|
||||
$('#slug-target').slugify('#slug-source');
|
||||
|
||||
$("#slug-target").slugify("#slug-source", {
|
||||
separator: '_'
|
||||
});
|
||||
25
types/jquery-slugify/tsconfig.json
Normal file
25
types/jquery-slugify/tsconfig.json
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"esModuleInterop": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"jquery-slugify-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/jquery-slugify/tslint.json
Normal file
1
types/jquery-slugify/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{"extends": "dtslint/dt.json"}
|
||||
Reference in New Issue
Block a user