mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-03 22:37:03 +00:00
Add type definition for domelementtype (#33854)
* Added new types for domelementtype * Updating PULL_REQUEST_TEMPLATE.md * Revert changes to .github/PULL_REQUEST_TEMPLATE.md
This commit is contained in:
committed by
Wesley Wigham
parent
145ceda256
commit
813999bd2b
@@ -0,0 +1,12 @@
|
||||
import { DomElementType } from "domelementtype";
|
||||
|
||||
console.log(DomElementType.Text === 'text');
|
||||
console.log(DomElementType.Directive === 'directive');
|
||||
console.log(DomElementType.Comment === 'comment');
|
||||
console.log(DomElementType.Script === 'script');
|
||||
console.log(DomElementType.Style === 'style');
|
||||
console.log(DomElementType.Tag === 'tag');
|
||||
console.log(DomElementType.CDATA === 'cdata');
|
||||
console.log(DomElementType.Doctype === 'doctype');
|
||||
console.log(DomElementType.isTag({ type: DomElementType.Tag }));
|
||||
console.log(DomElementType.isTag({ type: DomElementType.Doctype }));
|
||||
Vendored
+45
@@ -0,0 +1,45 @@
|
||||
// Type definitions for domelementtype 1.3
|
||||
// Project: https://github.com/fb55/domelementtype#readme
|
||||
// Definitions by: Johan Davidsson <https://github.com/johandavidson>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
export namespace DomElementType {
|
||||
/***
|
||||
* Text
|
||||
*/
|
||||
const Text = "text";
|
||||
/***
|
||||
* <? ... ?>
|
||||
*/
|
||||
const Directive = "directive";
|
||||
/***
|
||||
* <!-- ... -->
|
||||
*/
|
||||
const Comment = "comment";
|
||||
/***
|
||||
* <script> tags
|
||||
*/
|
||||
const Script = "script";
|
||||
/***
|
||||
* <style> tags
|
||||
*/
|
||||
const Style = "style";
|
||||
/***
|
||||
* Any tag
|
||||
*/
|
||||
const Tag = "tag";
|
||||
/***
|
||||
* <![CDATA[ ... ]]>
|
||||
*/
|
||||
const CDATA = "cdata";
|
||||
/***
|
||||
* <!DOCTYPE ... >
|
||||
*/
|
||||
const Doctype = "doctype";
|
||||
|
||||
/***
|
||||
* Checks whether element object is a tag
|
||||
*/
|
||||
function isTag(elem: { type: string}): boolean;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"domelementtype-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user