mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 12:56:46 +08:00
add title v1.0.0 by tj (#9675)
* add title v1.0.0 by tj * i made a mistake naming the file
This commit is contained in:
committed by
Masahiro Wakame
parent
9dba999267
commit
1d03fe4090
10
title/title-tests.ts
Normal file
10
title/title-tests.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
/// <reference path="./title.d.ts"/>
|
||||
import title = require("title");
|
||||
|
||||
var document = {title: "original"};
|
||||
|
||||
title("newtitle"); // document.title === 'newtitle'
|
||||
|
||||
title("%s - %o", "new"); // document.title === 'new - original'
|
||||
|
||||
title.reset(); // document.title === 'original'
|
||||
14
title/title.d.ts
vendored
Normal file
14
title/title.d.ts
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
// Type definitions for title v1.0.0
|
||||
// Project: https://www.npmjs.com/package/title
|
||||
// Definitions by: Fahad <https://github.com/fa7ad>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare module "title"{
|
||||
function Title(newtitle: string): void;
|
||||
function Title(pattern: string, newtitle?: string): void;
|
||||
namespace Title {
|
||||
function reset(): void;
|
||||
}
|
||||
|
||||
export = Title;
|
||||
}
|
||||
Reference in New Issue
Block a user