Skip to content

Commit 0718694

Browse files
devvaannshabose
authored andcommitted
docs: add utils dir missing jsdoc files
1 parent c0b53c4 commit 0718694

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1692
-606
lines changed

docs/API-Reference/utils/AppInit.md

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,42 @@ const AppInit = brackets.getModule("utils/AppInit")
66
<a name="Metrics"></a>
77

88
## Metrics
9-
Defines hooks to assist with module initialization.This module defines 3 methods for client modules to attach callbacks: - htmlReady - When the main application template is rendered - extensionsLoaded - When the extension manager has loaded all extensions - appReady - When Brackets completes loading all modules and extensionsThese are *not* jQuery events. Each method is similar to $(document).readyin that it will call the handler immediately if brackets is already doneloading.
9+
Defines hooks to assist with module initialization.
10+
11+
This module defines 3 methods for client modules to attach callbacks:
12+
- htmlReady - When the main application template is rendered
13+
- extensionsLoaded - When the extension manager has loaded all extensions
14+
- appReady - When Brackets completes loading all modules and extensions
15+
16+
These are *not* jQuery events. Each method is similar to $(document).ready
17+
in that it will call the handler immediately if brackets is already done
18+
loading.
19+
20+
**Kind**: global constant
21+
<a name="HTML_READY"></a>
22+
23+
## HTML\_READY : <code>string</code>
24+
Fires when the base htmlContent/main-view.html is loaded
25+
26+
**Kind**: global constant
27+
<a name="APP_READY"></a>
28+
29+
## APP\_READY : <code>string</code>
30+
Fires when all extensions are loaded
31+
32+
**Kind**: global constant
33+
<a name="EXTENSIONS_LOADED"></a>
34+
35+
## EXTENSIONS\_LOADED : <code>string</code>
36+
Fires after extensions have been loaded
1037

1138
**Kind**: global constant
1239
<a name="appReady"></a>
1340

1441
## appReady(handler)
15-
Adds a callback for the ready hook. Handlers are called afterhtmlReady is done, the initial project is loaded, and all extensions areloaded.
42+
Adds a callback for the ready hook. Handlers are called after
43+
htmlReady is done, the initial project is loaded, and all extensions are
44+
loaded.
1645

1746
**Kind**: global function
1847

@@ -23,7 +52,8 @@ Adds a callback for the ready hook. Handlers are called afterhtmlReady is done,
2352
<a name="htmlReady"></a>
2453

2554
## htmlReady(handler)
26-
Adds a callback for the htmlReady hook. Handlers are called after themain application html template is rendered.
55+
Adds a callback for the htmlReady hook. Handlers are called after the
56+
main application html template is rendered.
2757

2858
**Kind**: global function
2959

@@ -34,7 +64,8 @@ Adds a callback for the htmlReady hook. Handlers are called after themain appli
3464
<a name="extensionsLoaded"></a>
3565

3666
## extensionsLoaded(handler)
37-
Adds a callback for the extensionsLoaded hook. Handlers are called after theextensions have been loaded
67+
Adds a callback for the extensionsLoaded hook. Handlers are called after the
68+
extensions have been loaded
3869

3970
**Kind**: global function
4071

docs/API-Reference/utils/Async.md

Lines changed: 146 additions & 15 deletions
Large diffs are not rendered by default.

docs/API-Reference/utils/ColorUtils.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,29 @@ const ColorUtils = brackets.getModule("utils/ColorUtils")
66
<a name="@type"></a>
77

88
## @type : <code>Array</code>
9-
Sorted array of all the color names in the CSS Color Module Level 3 (http://www.w3.org/TR/css3-color/)and "rebeccapurple" from CSS Color Module Level 4
9+
Sorted array of all the color names in the CSS Color Module Level 3 (http://www.w3.org/TR/css3-color/)
10+
and "rebeccapurple" from CSS Color Module Level 4
1011

1112
**Kind**: global constant
1213
<a name="@type"></a>
1314

1415
## @type : <code>RegExp</code>
15-
Regular expression that matches reasonably well-formed colors in hex format (3 or 6 digits),rgb()/rgba() function format, hsl()/hsla() function format, 0x notation formator color name format according to CSS Color Module Level 3 (http://www.w3.org/TR/css3-color/)or "rebeccapurple" from CSS Color Module Level 4.
16+
Regular expression that matches reasonably well-formed colors in hex format (3 or 6 digits),
17+
rgb()/rgba() function format, hsl()/hsla() function format, 0x notation format
18+
or color name format according to CSS Color Module Level 3 (http://www.w3.org/TR/css3-color/)
19+
or "rebeccapurple" from CSS Color Module Level 4.
1620

1721
**Kind**: global constant
22+
<a name="formatColorHint"></a>
23+
24+
## formatColorHint($hintObj, color) ⇒ <code>jQuery</code>
25+
Adds a color swatch to code hints where this is supported.
26+
27+
**Kind**: global function
28+
**Returns**: <code>jQuery</code> - jQuery object with the correct class and/or style applied
29+
30+
| Param | Type | Description |
31+
| --- | --- | --- |
32+
| $hintObj | <code>jQuery</code> | list item where the swatch will be in |
33+
| color | <code>string</code> | color the swatch should have, or null to add extra left margin to align with the other hints |
34+

docs/API-Reference/utils/DeprecationWarning.md

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,11 @@ const DeprecationWarning = brackets.getModule("utils/DeprecationWarning")
99
Utilities functions to display deprecation warning in the console.
1010

1111
**Kind**: global variable
12-
<a name="_trimStack"></a>
13-
14-
## \_trimStack()
15-
Trim the stack so that it does not have the call to this module,and all the calls to require.js to load the extension that showsthis deprecation warning.
16-
17-
**Kind**: global function
1812
<a name="deprecationWarning"></a>
1913

2014
## deprecationWarning(message, [oncePerCaller], [callerStackPos])
21-
Show deprecation warning with the call stack if ithas never been displayed before.
15+
Show deprecation warning with the call stack if it
16+
has never been displayed before.
2217

2318
**Kind**: global function
2419

@@ -31,7 +26,16 @@ Show deprecation warning with the call stack if ithas never been displayed befo
3126
<a name="deprecateEvent"></a>
3227

3328
## deprecateEvent(outbound, inbound, oldEventName, newEventName, [canonicalOutboundName], [canonicalInboundName])
34-
Show a deprecation warning if there are listeners for the event``` DeprecationWarning.deprecateEvent(exports, MainViewManager, "workingSetAdd", "workingSetAdd", "DocumentManager.workingSetAdd", "MainViewManager.workingSetAdd");```
29+
Show a deprecation warning if there are listeners for the event
30+
31+
```
32+
DeprecationWarning.deprecateEvent(exports,
33+
MainViewManager,
34+
"workingSetAdd",
35+
"workingSetAdd",
36+
"DocumentManager.workingSetAdd",
37+
"MainViewManager.workingSetAdd");
38+
```
3539

3640
**Kind**: global function
3741

@@ -46,13 +50,14 @@ Show a deprecation warning if there are listeners for the event``` Deprecat
4650

4751
<a name="deprecateConstant"></a>
4852

49-
## deprecateConstant(old, new)
53+
## deprecateConstant(obj, oldId, newId)
5054
Create a deprecation warning and action for updated constants
5155

5256
**Kind**: global function
5357

5458
| Param | Type | Description |
5559
| --- | --- | --- |
56-
| old | <code>string</code> | Menu Id |
57-
| new | <code>string</code> | Menu Id |
60+
| obj | <code>Object</code> | |
61+
| oldId | <code>string</code> | Menu Id |
62+
| newId | <code>string</code> | Menu Id |
5863

docs/API-Reference/utils/DragAndDrop.md

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,33 +15,23 @@ Returns true if the drag and drop items contains valid drop objects.
1515
| --- | --- | --- |
1616
| items | <code>Array.&lt;DataTransferItem&gt;</code> | Array of items being dragged |
1717

18-
<a name="stopURIListPropagation"></a>
19-
20-
## stopURIListPropagation(files, event)
21-
Determines if the event contains a type list that has a URI-list.If it does and contains an empty file list, then what is being dropped is a URL.If that is true then we stop the event propagation and default behavior to save Brackets editor from the browser taking over.
22-
23-
**Kind**: global function
24-
25-
| Param | Type | Description |
26-
| --- | --- | --- |
27-
| files | <code>Array.&lt;File&gt;</code> | Array of File objects from the event datastructure. URLs are the only drop item that would contain a URI-list. |
28-
| event | <code>event</code> | The event datastucture containing datatransfer information about the drag/drop event. Contains a type list which may or may not hold a URI-list depending on what was dragged/dropped. Interested if it does. |
29-
3018
<a name="openDroppedFiles"></a>
3119

32-
## openDroppedFiles(files) ⇒ <code>Promise</code>
20+
## openDroppedFiles(paths) ⇒ <code>Promise</code>
3321
Open dropped files
3422

3523
**Kind**: global function
36-
**Returns**: <code>Promise</code> - Promise that is resolved if all files are opened, or rejected if there was an error.
24+
**Returns**: <code>Promise</code> - Promise that is resolved if all files are opened, or rejected
25+
if there was an error.
3726

3827
| Param | Type | Description |
3928
| --- | --- | --- |
40-
| files | <code>Array.&lt;string&gt;</code> | Array of files dropped on the application. |
29+
| paths | <code>Array.&lt;string&gt;</code> | Array of file paths dropped on the application. |
4130

4231
<a name="attachHandlers"></a>
4332

4433
## attachHandlers()
45-
Attaches global drag & drop handlers to this window. This enables dropping files/folders to open them, and alsoprotects the Brackets app from being replaced by the browser trying to load the dropped file in its place.
34+
Attaches global drag & drop handlers to this window. This enables dropping files/folders to open them, and also
35+
protects the Brackets app from being replaced by the browser trying to load the dropped file in its place.
4636

4737
**Kind**: global function

docs/API-Reference/utils/DropdownEventHandler.md

Lines changed: 16 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,28 @@ const DropdownEventHandler = brackets.getModule("utils/DropdownEventHandler")
1111
* [DropdownEventHandler](#DropdownEventHandler)
1212
* [new DropdownEventHandler($list, selectionCallback, closeCallback, keyDownCallback)](#new_DropdownEventHandler_new)
1313
* [.open()](#DropdownEventHandler+open)
14-
* [._keydownHook(event)](#DropdownEventHandler+open.._keydownHook) ⇒ <code>boolean</code>
15-
* [.closeCallback()](#DropdownEventHandler+open..closeCallback)
1614
* [.close()](#DropdownEventHandler+close)
17-
* [._cleanup()](#DropdownEventHandler+_cleanup)
18-
* [._tryToSelect(index, direction, [noWrap])](#DropdownEventHandler+_tryToSelect)
19-
* [._itemsPerPage()](#DropdownEventHandler+_itemsPerPage) ⇒ <code>number</code>
20-
* [._selectionHandler()](#DropdownEventHandler+_selectionHandler)
21-
* [._clickHandler($item)](#DropdownEventHandler+_clickHandler)
22-
* [._registerMouseEvents()](#DropdownEventHandler+_registerMouseEvents)
2315
* [.reRegisterMouseHandlers($list)](#DropdownEventHandler+reRegisterMouseHandlers)
2416

2517
<a name="new_DropdownEventHandler_new"></a>
2618

2719
### new DropdownEventHandler($list, selectionCallback, closeCallback, keyDownCallback)
28-
Object to handle events for a dropdown list.DropdownEventHandler handles these events:Mouse:- click - execute selection callback and dismiss list- mouseover - highlight item- mouseleave - remove mouse highlightingKeyboard:- Enter - execute selection callback and dismiss list- Esc - dismiss list- Up/Down - change selection- PageUp/Down - change selectionItems whose "a" has the .disabled class do not respond to selection.
20+
Object to handle events for a dropdown list.
21+
22+
DropdownEventHandler handles these events:
23+
24+
Mouse:
25+
- click - execute selection callback and dismiss list
26+
- mouseover - highlight item
27+
- mouseleave - remove mouse highlighting
28+
29+
Keyboard:
30+
- Enter - execute selection callback and dismiss list
31+
- Esc - dismiss list
32+
- Up/Down - change selection
33+
- PageUp/Down - change selection
34+
35+
Items whose "a" has the .disabled class do not respond to selection.
2936

3037

3138
| Param | Type | Description |
@@ -41,81 +48,11 @@ Object to handle events for a dropdown list.DropdownEventHandler handles these
4148
Public open method
4249

4350
**Kind**: instance method of [<code>DropdownEventHandler</code>](#DropdownEventHandler)
44-
45-
* [.open()](#DropdownEventHandler+open)
46-
* [._keydownHook(event)](#DropdownEventHandler+open.._keydownHook) ⇒ <code>boolean</code>
47-
* [.closeCallback()](#DropdownEventHandler+open..closeCallback)
48-
49-
<a name="DropdownEventHandler+open.._keydownHook"></a>
50-
51-
#### open.\_keydownHook(event) ⇒ <code>boolean</code>
52-
Convert keydown events into hint list navigation actions.
53-
54-
**Kind**: inner method of [<code>open</code>](#DropdownEventHandler+open)
55-
**Returns**: <code>boolean</code> - true if key was handled, otherwise false.
56-
57-
| Param | Type |
58-
| --- | --- |
59-
| event | <code>KeyboardEvent</code> |
60-
61-
<a name="DropdownEventHandler+open..closeCallback"></a>
62-
63-
#### open.closeCallback()
64-
PopUpManager callback
65-
66-
**Kind**: inner method of [<code>open</code>](#DropdownEventHandler+open)
6751
<a name="DropdownEventHandler+close"></a>
6852

6953
### dropdownEventHandler.close()
7054
Public close method
7155

72-
**Kind**: instance method of [<code>DropdownEventHandler</code>](#DropdownEventHandler)
73-
<a name="DropdownEventHandler+_cleanup"></a>
74-
75-
### dropdownEventHandler.\_cleanup()
76-
Cleanup
77-
78-
**Kind**: instance method of [<code>DropdownEventHandler</code>](#DropdownEventHandler)
79-
<a name="DropdownEventHandler+_tryToSelect"></a>
80-
81-
### dropdownEventHandler.\_tryToSelect(index, direction, [noWrap])
82-
Try to select item at the given index. If it's disabled or a divider, keep trying by incrementingindex by 'direction' each time (wrapping around if needed).
83-
84-
**Kind**: instance method of [<code>DropdownEventHandler</code>](#DropdownEventHandler)
85-
86-
| Param | Type | Description |
87-
| --- | --- | --- |
88-
| index | <code>number</code> | If out of bounds, index either wraps around to remain in range (e.g. -1 yields last item, length+1 yields 2nd item) or if noWrap set, clips instead (e.g. -1 yields first item, length+1 yields last item). |
89-
| direction | <code>number</code> | Either +1 or -1 |
90-
| [noWrap] | <code>boolean</code> | Clip out of range index values instead of wrapping. Default false (wrap). |
91-
92-
<a name="DropdownEventHandler+_itemsPerPage"></a>
93-
94-
### dropdownEventHandler.\_itemsPerPage() ⇒ <code>number</code>
95-
**Kind**: instance method of [<code>DropdownEventHandler</code>](#DropdownEventHandler)
96-
**Returns**: <code>number</code> - The number of items per scroll page.
97-
<a name="DropdownEventHandler+_selectionHandler"></a>
98-
99-
### dropdownEventHandler.\_selectionHandler()
100-
Call selectionCallback with selected index
101-
102-
**Kind**: instance method of [<code>DropdownEventHandler</code>](#DropdownEventHandler)
103-
<a name="DropdownEventHandler+_clickHandler"></a>
104-
105-
### dropdownEventHandler.\_clickHandler($item)
106-
Call selectionCallback with selected item
107-
108-
**Kind**: instance method of [<code>DropdownEventHandler</code>](#DropdownEventHandler)
109-
110-
| Param | Type |
111-
| --- | --- |
112-
| $item | <code>jQueryObject</code> |
113-
114-
<a name="DropdownEventHandler+_registerMouseEvents"></a>
115-
116-
### dropdownEventHandler.\_registerMouseEvents()
117-
Register mouse event handlers
118-
11956
**Kind**: instance method of [<code>DropdownEventHandler</code>](#DropdownEventHandler)
12057
<a name="DropdownEventHandler+reRegisterMouseHandlers"></a>
12158

0 commit comments

Comments
 (0)