mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
added _.uniqueId definition
This commit is contained in:
@@ -771,6 +771,8 @@ result = <any[]>_.times(3, function(n: number) { this.cast(n); }, mage);
|
||||
|
||||
result = <string>_.unescape('Moe, Larry & Curly');
|
||||
|
||||
result = <string>_.uniqueId('contact_');
|
||||
result = <string>_.uniqueId();
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
Vendored
+5
-15
@@ -2844,24 +2844,14 @@ declare module _ {
|
||||
* @return The unescaped string.
|
||||
**/
|
||||
export function unescape(
|
||||
string: string): string;
|
||||
|
||||
|
||||
|
||||
|
||||
string: string): string;
|
||||
|
||||
/**
|
||||
* Generate a globally-unique id for client-side models or DOM elements that need one.
|
||||
* If prefix is passed, the id will be appended to it. Without prefix, returns an integer.
|
||||
* @param prefix A prefix string to start the unique ID with.
|
||||
* @return Unique string ID beginning with `prefix`.
|
||||
* Generates a unique ID. If prefix is provided the ID will be appended to it.
|
||||
* @param prefix The value to prefix the ID with.
|
||||
* @return Returns the unique ID.
|
||||
**/
|
||||
export function uniqueId(prefix: string): string;
|
||||
|
||||
/**
|
||||
* @see _.uniqueId
|
||||
**/
|
||||
export function uniqueId(): number;
|
||||
export function uniqueId(prefix?: string): string;
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user