-
Notifications
You must be signed in to change notification settings - Fork 606
TypeScript #1373
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
Open
tristen
wants to merge
61
commits into
main
Choose a base branch
from
tsc
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+15,144
−11,574
Open
TypeScript #1373
Changes from all commits
Commits
Show all changes
61 commits
Select commit
Hold shift + click to select a range
94dbec2
Incrementally update
tristen 0e08763
Lose extensions on imports
tristen f81f483
Declare class
tristen 60e274d
More conversion
tristen f8166b3
Move all source .js to .ts
tristen 88f9cb1
Format everything
tristen 6c95cc9
Fix bad reference to getFeaturesAt
tristen 2098903
More TypeScript setup
tristen dd83eed
Convet more to TypeScript
tristen 8cdbaf0
Tackle smaller libs
tristen 0a746b8
Move feature_types to classes
tristen f7cc701
Start over again with @types/mapbox-gl-draw
tristen 711f71c
Reformatting wave
tristen 045467d
More typing
tristen 5b71f7b
Simple typings for common selectors
tristen bf78fe6
More typings
tristen e1cc500
More type safety, nest properties in mode objects
tristen c865b76
More
tristen 2923db4
More
tristen 2f8abc0
Drop unused method
tristen 9506e08
Bad typing for QRF
tristen 7a00968
Add argument signatures to mode interface and do not recast
tristen 1b4c52e
Walk back
tristen 2792160
Reduce the scope of this PR by skipping bench stuff
tristen 2e24ed1
Reduce scope further
tristen d23d156
Bad conditional
tristen 05cf584
Walk back on eslint stuff
tristen 3b48ac1
eslint changes
tristen 1c2bc4c
Consistify direct select with object+property of other modes
tristen 64cd9df
Mode state interface
tristen dd3b5d2
More typings for direct_select
tristen 06ebad2
Organize, use ModeCTX directly
tristen 5daaa4a
Simplify
tristen c6ec967
String is also accepted
tristen 341d3ac
Fixes to store
tristen aa98282
More on store
tristen 34798cf
Work on api
tristen fe4d933
More typing
tristen 4755a90
Finish api
tristen 7276daa
Add ts-node loader and drop js extensions in test files
tristen 8560abb
Convert the rest of lib to named exports
tristen 77877c4
Move test files to typescript
tristen cebd5ab
Simplify
tristen 11fc1c4
Some type coersion for tests
tristen b32aad7
More typings for tests
tristen 9b0ca09
More types more coercing for mocks
tristen a1e18d9
More typings for tests
tristen 7f1f5c5
Do some spy mocking
tristen 195b056
More spy coersion
tristen ac8d989
Finish up the pass on tsc errors in tests
tristen 041405c
tsx is better?
tristen 845a741
Fixes to TypeScript for tests
tristen 31a7035
Lint fixes suspiciously light
tristen b54417b
Bad typo
tristen 7257289
Need to confirm undefined here
tristen 57a7828
Merge branch 'main' into tsc
tristen 37b1e97
Not a major version bump
tristen bd51259
Fix rollup
tristen dde51f2
Drop `export` where it is not necessary
tristen d180d1f
Remove overriding method
tristen 326426e
Merge branch 'main' into tsc
tristen 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 hidden or 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
This file contains hidden or 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
This file contains hidden or 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 @@ | ||
| npm test |
This file contains hidden or 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
This file contains hidden or 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
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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,38 @@ | ||
| import { spy } from 'sinon'; | ||
| import runSetup from './src/setup'; | ||
| import { configureOptions } from './src/options'; | ||
| import setupAPI from './src/api'; | ||
| import * as modes from './src/modes/index'; | ||
| import * as Constants from './src/constants'; | ||
| import * as lib from './src/lib/index'; | ||
| import type { DrawOptions, Draw } from './src/types/types'; | ||
|
|
||
| const setupDraw = (options: DrawOptions, api: Draw) => { | ||
| options = configureOptions(options); | ||
|
|
||
| const ctx = { | ||
| options | ||
| } as spy; | ||
|
|
||
| api = setupAPI(ctx, api); | ||
| ctx.api = api; | ||
|
|
||
| const setup = runSetup(ctx); | ||
|
|
||
| api.onAdd = setup.onAdd; | ||
| api.onRemove = setup.onRemove; | ||
| api.types = Constants.types; | ||
| api.options = options; | ||
|
|
||
| return api; | ||
| }; | ||
|
|
||
| function MapboxDraw(options?: DrawOptions) { | ||
| setupDraw(options, this); | ||
| } | ||
|
|
||
| MapboxDraw.modes = modes; | ||
| MapboxDraw.constants = Constants; | ||
| MapboxDraw.lib = lib; | ||
|
|
||
| export default MapboxDraw; | ||
Oops, something went wrong.
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.
Why do we have this test-related cast here?