-
-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add types #14
Merged
Merged
Add types #14
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
5505d03
Add types
TaylorBeeston 10dae3b
Add TSDoc annotations
TaylorBeeston 4311b4f
Add additional type test cases
TaylorBeeston 6a8818b
Add function overload
TaylorBeeston 43576ab
Proposal to handle s
TaylorBeeston ed252a3
Move @types/hast to dependencies
TaylorBeeston 518c004
Update semver of dtslint to ^3.0.0
TaylorBeeston aa0b4a5
Flatten type defintions
TaylorBeeston File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -27,7 +27,9 @@ | |||||
"contributors": [ | ||||||
"Titus Wormer <[email protected]> (https://wooorm.com)" | ||||||
], | ||||||
"types": "types/index.d.ts", | ||||||
"files": [ | ||||||
"types/index.d.ts", | ||||||
"index.js", | ||||||
"factory.js", | ||||||
"html.js", | ||||||
|
@@ -41,7 +43,9 @@ | |||||
"space-separated-tokens": "^1.0.0" | ||||||
}, | ||||||
"devDependencies": { | ||||||
"@types/hast": "^2.3.1", | ||||||
"browserify": "^16.0.0", | ||||||
"dtslint": "^3.6.12", | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
"nyc": "^15.0.0", | ||||||
"prettier": "^2.0.0", | ||||||
"remark-cli": "^8.0.0", | ||||||
|
@@ -59,7 +63,8 @@ | |||||
"build": "npm run build-bundle && npm run build-mangle", | ||||||
"test-api": "node test", | ||||||
"test-coverage": "nyc --reporter lcov tape test.js", | ||||||
"test": "npm run generate && npm run format && npm run build && npm run test-coverage" | ||||||
"test-types": "dtslint types", | ||||||
"test": "npm run generate && npm run format && npm run build && npm run test-coverage && npm run test-types" | ||||||
}, | ||||||
"nyc": { | ||||||
"check-coverage": true, | ||||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import h = require('hastscript') | ||
|
||
h() | ||
h('.bar', {class: 'bar'}) | ||
h('.foo', {class: 'bar'}, h('.baz')) | ||
TaylorBeeston marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// TypeScript Version: 3.5 | ||
|
||
import {Element, Properties, Node} from 'hast' | ||
|
||
declare function hastscript( | ||
TaylorBeeston marked this conversation as resolved.
Show resolved
Hide resolved
|
||
selector?: string, | ||
properties?: Properties, | ||
children?: string | Node | Array<string | Node> | ||
): Element | ||
|
||
export = hastscript |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"compilerOptions": { | ||
"lib": ["es2015"], | ||
"strict": true, | ||
"baseUrl": ".", | ||
"paths": { | ||
"hastscript": ["index.d.ts"] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"extends": "dtslint/dtslint.json", | ||
"rules": { | ||
"semicolon": false, | ||
"whitespace": false | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we’re putting dependent types in
dependencies
directly now, not in dev-deps.