This repository was archived by the owner on Dec 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 33
TypeScript #28
Merged
Merged
TypeScript #28
Changes from all commits
Commits
Show all changes
50 commits
Select commit
Hold shift + click to select a range
b5e3aa3
Create tsconfig.json
aminya c9e3006
Add dev deps + Add Eslint/TsLint + prettier config
aminya 06f8a4e
Add scripts
aminya 361cbb9
js-to-ts-converter .
aminya 9642dda
import instead of require for atom/fuzzaldrin
aminya ef4bba6
global not needed for atom
aminya db55db1
SelectListView members + SelectListProperties interface
aminya c3bf30e
etch type temporarily
aminya 7a6850a
TODO: fix redundant returns in methods
aminya 89a593a
this.items = props.items + TODO
aminya fc980cd
CommandEvent
aminya 84471b7
itemIndex: number
aminya fb0e265
updateComponent?: boolean
aminya 3aae572
fuzzyFilter types
aminya bc68e9c
const score
aminya def1ee7
props types
aminya b969819
MouseEvent
aminya fae6b9a
export update
aminya 9ee731d
JSDoc style doc strings
aminya 533da24
Rename src_src to src - output in lib
aminya b2722a9
separate file for SelectListProperties
aminya 93718c2
Remoev tslint, eslint, prettier
aminya beb3f3f
Update tsconfig
aminya a37549c
Break on tsc errors
aminya af6f304
Wrap long docs
aminya e5df058
Use // for normal comments
aminya 5abb4f0
Factor out ListItemViewProps
aminya 4b5e63b
Update and move tsconfig
aminya eaf175d
Move and change import/require
aminya 31f3665
Add dev script
aminya 72f9d01
Remove unused locals
aminya 43b1d75
Move strict tsconfig
aminya cf1cac7
noImplicitAny and strict
aminya d5d3736
Fix fuzzaldrin types
aminya cc81360
Use in instead of hasOwnProperty
aminya 231df2c
Replace the deprecated scrollIntoViewIfNeeded
aminya fd8902f
Downgrade sinon
aminya c021cc9
Bump typescript deps
aminya cdf3129
Use ES5 export style (to prevent exports.default)
aminya 8818ab0
Depend on strict for noImplicitAny and noImplicitThis
aminya e2bff3a
Make skipCommandsRegistration optional
aminya f43e920
remove space
aminya 246ff18
Make items private
aminya 0e9dc1f
Revert "Replace the deprecated scrollIntoViewIfNeeded"
aminya 80c3e14
Add ts-ignore for scrollIntoViewIfNeeded
aminya 180f224
Remove initial assignment to this.items
aminya 414607f
update the docstring for items
aminya 3c11348
Fix the type for this.refs.items.children
aminya b4a58f7
Remove {} from the default value for props
aminya b07cbec
remove space
aminya 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,3 +2,4 @@ | |
| .DS_Store | ||
| npm-debug.log | ||
| package-lock.json | ||
| lib | ||
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,88 @@ | ||
| import { EtchElement } from './select-list-view' // TODO: etch types | ||
|
|
||
| export interface SelectListProperties { | ||
| /** an array containing the objects you want to show in the select list. */ | ||
| items: Array<object | string> | ||
|
|
||
| /** | ||
| * a function that is called whenever an item needs to be displayed. | ||
| * | ||
| * `options: { selected: boolean, index: number, visible: boolean }` | ||
| * | ||
| * - `selected`: indicating whether item is selected or not. | ||
| * - `index`: item's index. | ||
| * - `visible`: indicating whether item is visible in viewport or not. Unless initiallyVisibleItemCount was given, | ||
| this value is always true. | ||
| */ | ||
| elementForItem: ( | ||
| item: object | string, | ||
| options: { selected: boolean; index: number; visible: boolean } | ||
| ) => EtchElement // TODO: HTMLElement | ||
|
|
||
| /** (Optional) the number of maximum items that are shown. */ | ||
| maxResults?: number | ||
|
|
||
| /** (Optional) a function that allows to decide which items to show whenever the query changes. | ||
| By default, it uses fuzzaldrin to filter results. */ | ||
| filter?: (items: Array<object | string>, query: string) => Array<object> | ||
|
|
||
| /** (Optional) when filter is not provided, this function will be called to retrieve a string property on each item, | ||
| and that will be used to filter them. */ | ||
| filterKeyForItem?: (item: object | string) => string | ||
|
|
||
| /** (Optional) a function that allows to apply a transformation to the user query and whose return value | ||
| will be used to filter items. */ | ||
| filterQuery?: (query: string) => string | ||
|
|
||
| /** (Optional) a string that will replace the contents of the query editor. */ | ||
| query?: string | ||
|
|
||
| /** (Optional) a boolean indicating whether the query text should be selected or not. */ | ||
| selectQuery?: boolean | ||
|
|
||
| /** (Optional) a function that allows to change the order in which items are shown. */ | ||
| order?: (item1: object | string, item2: object | string) => number | ||
|
|
||
| /** (Optional) a string shown when the list is empty. */ | ||
| emptyMessage?: string | ||
|
|
||
| /** (Optional) a string that needs to be set when you want to notify the user that an error occurred. */ | ||
| errorMessage?: string | ||
|
|
||
| /** (Optional) a string that needs to be set when you want to provide some information to the user. */ | ||
| infoMessage?: string | ||
|
|
||
| /** (Optional) a string that needs to be set when you are loading items in the background. */ | ||
| loadingMessage?: string | ||
|
|
||
| /** (Optional) a string or number that needs to be set when the progress status changes | ||
| (e.g. a percentage showing how many items have been loaded so far). */ | ||
| loadingBadge?: string | number | ||
|
|
||
| /** (Optional) an array of strings that will be added as class names to the items element. */ | ||
| itemsClassList?: Array<string> | ||
|
|
||
| /** (Optional) the index of the item to initially select and automatically select after query changes; defaults to 0. */ | ||
| initialSelectionIndex?: number | ||
|
|
||
| /** (Optional) a function that is called when the query changes. */ | ||
| didChangeQuery?: (query: string) => void | ||
|
|
||
| /** (Optional) a function that is called when the selected item changes. */ | ||
| didChangeSelection?: (item: object | string) => void | ||
|
|
||
| /** (Optional) a function that is called when the user clicks or presses Enter on an item. */ | ||
| didConfirmSelection?: (item: object | string) => void | ||
|
|
||
| /** (Optional) a function that is called when the user presses Enter but the list is empty. */ | ||
| didConfirmEmptySelection?: () => void | ||
|
|
||
| /** (Optional) a function that is called when the user presses Esc or the list loses focus. */ | ||
| didCancelSelection?: () => void | ||
|
|
||
| /** (Optional) When this options was provided, SelectList observe visibility of items in viewport, visibility state is | ||
| passed as visible option to elementForItem. This is mainly used to skip heavy computation for invisible items. */ | ||
| initiallyVisibleItemCount?: number | ||
|
|
||
| skipCommandsRegistration?: boolean | ||
| } |
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.
Uh oh!
There was an error while loading. Please reload this page.