Skip to content

Commit

Permalink
docs: add new files to API docs and add missing jsdoc content
Browse files Browse the repository at this point in the history
  • Loading branch information
devvaannsh committed Oct 29, 2024
1 parent 746e8e2 commit c215cdb
Show file tree
Hide file tree
Showing 10 changed files with 496 additions and 19 deletions.
110 changes: 110 additions & 0 deletions docs/API-Reference/view/PanelView.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
### Import :
```js
const PanelView = brackets.getModule("view/PanelView")
```

<a name="Panel"></a>

## Panel
**Kind**: global class

* [Panel](#Panel)
* [new Panel($panel)](#new_Panel_new)
* [.$panel](#Panel+$panel) : <code>jQueryObject</code>
* [.isVisible()](#Panel+isVisible) ⇒ <code>boolean</code>
* [.registerCanBeShownHandler(canShowHandlerFn)](#Panel+registerCanBeShownHandler) ⇒ <code>boolean</code>
* [.canBeShown()](#Panel+canBeShown) ⇒ <code>boolean</code>
* [.show()](#Panel+show)
* [.hide()](#Panel+hide)
* [.setVisible(visible)](#Panel+setVisible)
* [.getPanelType()](#Panel+getPanelType) ⇒ <code>string</code>

<a name="new_Panel_new"></a>

### new Panel($panel)
Represents a panel below the editor area (a child of ".content").


| Param | Type | Description |
| --- | --- | --- |
| $panel | <code>jQueryObject</code> | The entire panel, including any chrome, already in the DOM. |

<a name="Panel+$panel"></a>

### panel.$panel : <code>jQueryObject</code>
Dom node holding the rendered panel

**Kind**: instance property of [<code>Panel</code>](#Panel)
<a name="Panel+isVisible"></a>

### panel.isVisible() ⇒ <code>boolean</code>
Determines if the panel is visible

**Kind**: instance method of [<code>Panel</code>](#Panel)
**Returns**: <code>boolean</code> - true if visible, false if not
<a name="Panel+registerCanBeShownHandler"></a>

### panel.registerCanBeShownHandler(canShowHandlerFn) ⇒ <code>boolean</code>
Registers a call back function that will be called just before panel is shown. The handler should return true
if the panel can be shown, else return false and the panel will not be shown.

**Kind**: instance method of [<code>Panel</code>](#Panel)
**Returns**: <code>boolean</code> - true if visible, false if not

| Param | Type | Description |
| --- | --- | --- |
| canShowHandlerFn | <code>function</code> \| <code>null</code> | function that should return true of false if the panel can be shown/not. or null to clear the handler. |

<a name="Panel+canBeShown"></a>

### panel.canBeShown() ⇒ <code>boolean</code>
Returns true if th panel can be shown, else false.

**Kind**: instance method of [<code>Panel</code>](#Panel)
<a name="Panel+show"></a>

### panel.show()
Shows the panel

**Kind**: instance method of [<code>Panel</code>](#Panel)
<a name="Panel+hide"></a>

### panel.hide()
Hides the panel

**Kind**: instance method of [<code>Panel</code>](#Panel)
<a name="Panel+setVisible"></a>

### panel.setVisible(visible)
Sets the panel's visibility state

**Kind**: instance method of [<code>Panel</code>](#Panel)

| Param | Type | Description |
| --- | --- | --- |
| visible | <code>boolean</code> | true to show, false to hide |

<a name="Panel+getPanelType"></a>

### panel.getPanelType() ⇒ <code>string</code>
gets the Panel's type

**Kind**: instance method of [<code>Panel</code>](#Panel)
<a name="EVENT_PANEL_HIDDEN"></a>

## EVENT\_PANEL\_HIDDEN : <code>string</code>
Event when panel is hidden

**Kind**: global constant
<a name="EVENT_PANEL_SHOWN"></a>

## EVENT\_PANEL\_SHOWN : <code>string</code>
Event when panel is shown

**Kind**: global constant
<a name="PANEL_TYPE_BOTTOM_PANEL"></a>

## PANEL\_TYPE\_BOTTOM\_PANEL : <code>string</code>
type for bottom panel

**Kind**: global constant
114 changes: 114 additions & 0 deletions docs/API-Reference/view/PluginPanelView.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
### Import :
```js
const PluginPanelView = brackets.getModule("view/PluginPanelView")
```

<a name="Panel"></a>

## Panel
**Kind**: global class

* [Panel](#Panel)
* [new Panel($panel, id, $toolbarIcon, [minWidth], [initialSize])](#new_Panel_new)
* [.$panel](#Panel+$panel) : <code>jQueryObject</code>
* [.isVisible()](#Panel+isVisible) ⇒ <code>boolean</code>
* [.registerCanBeShownHandler(canShowHandlerFn)](#Panel+registerCanBeShownHandler) ⇒ <code>boolean</code>
* [.canBeShown()](#Panel+canBeShown) ⇒ <code>boolean</code>
* [.show()](#Panel+show)
* [.hide()](#Panel+hide)
* [.setVisible(visible)](#Panel+setVisible)
* [.getPanelType()](#Panel+getPanelType) ⇒ <code>string</code>

<a name="new_Panel_new"></a>

### new Panel($panel, id, $toolbarIcon, [minWidth], [initialSize])
Represents a panel below the editor area (a child of ".content").


| Param | Type | Description |
| --- | --- | --- |
| $panel | <code>jQueryObject</code> | The entire panel, including any chrome, already in the DOM. |
| id | <code>string</code> | Unique id for this panel. Use package-style naming, e.g. "myextension.panelname". will overwrite an existing panel id if present. |
| $toolbarIcon | <code>jQueryObject</code> | An icon that should be present in main-toolbar to associate this panel to. The panel will be shown only if the icon is visible on the toolbar and the user clicks on the icon. |
| [minWidth] | <code>number</code> | Minimum width of panel in px. |
| [initialSize] | <code>number</code> | Optional Initial size of panel in px. If not given, panel will use minsize or current size. |

<a name="Panel+$panel"></a>

### panel.$panel : <code>jQueryObject</code>
Dom node holding the rendered panel

**Kind**: instance property of [<code>Panel</code>](#Panel)
<a name="Panel+isVisible"></a>

### panel.isVisible() ⇒ <code>boolean</code>
Determines if the panel is visible

**Kind**: instance method of [<code>Panel</code>](#Panel)
**Returns**: <code>boolean</code> - true if visible, false if not
<a name="Panel+registerCanBeShownHandler"></a>

### panel.registerCanBeShownHandler(canShowHandlerFn) ⇒ <code>boolean</code>
Registers a call back function that will be called just before panel is shown. The handler should return true
if the panel can be shown, else return false and the panel will not be shown.

**Kind**: instance method of [<code>Panel</code>](#Panel)
**Returns**: <code>boolean</code> - true if visible, false if not

| Param | Type | Description |
| --- | --- | --- |
| canShowHandlerFn | <code>function</code> \| <code>null</code> | function that should return true of false if the panel can be shown/not. or null to clear the handler. |

<a name="Panel+canBeShown"></a>

### panel.canBeShown() ⇒ <code>boolean</code>
Returns true if th panel can be shown, else false.

**Kind**: instance method of [<code>Panel</code>](#Panel)
<a name="Panel+show"></a>

### panel.show()
Shows the panel

**Kind**: instance method of [<code>Panel</code>](#Panel)
<a name="Panel+hide"></a>

### panel.hide()
Hides the panel

**Kind**: instance method of [<code>Panel</code>](#Panel)
<a name="Panel+setVisible"></a>

### panel.setVisible(visible)
Sets the panel's visibility state

**Kind**: instance method of [<code>Panel</code>](#Panel)

| Param | Type | Description |
| --- | --- | --- |
| visible | <code>boolean</code> | true to show, false to hide |

<a name="Panel+getPanelType"></a>

### panel.getPanelType() ⇒ <code>string</code>
gets the Panel's type

**Kind**: instance method of [<code>Panel</code>](#Panel)
<a name="EVENT_PANEL_HIDDEN"></a>

## EVENT\_PANEL\_HIDDEN : <code>string</code>
Event when panel is hidden

**Kind**: global constant
<a name="EVENT_PANEL_SHOWN"></a>

## EVENT\_PANEL\_SHOWN : <code>string</code>
Event when panel is shown

**Kind**: global constant
<a name="PANEL_TYPE_PLUGIN_PANEL"></a>

## PANEL\_TYPE\_PLUGIN\_PANEL : <code>string</code>
type for plugin panel

**Kind**: global constant
85 changes: 85 additions & 0 deletions docs/API-Reference/view/ThemeManager.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
### Import :
```js
const ThemeManager = brackets.getModule("view/ThemeManager")
```

<a name="EVENT_THEME_CHANGE"></a>

## EVENT\_THEME\_CHANGE : <code>string</code>
Event when theme is changed

**Kind**: global constant
<a name="EVENT_THEME_LOADED"></a>

## EVENT\_THEME\_LOADED : <code>string</code>
Event when theme is loaded

**Kind**: global constant
<a name="getCurrentTheme"></a>

## getCurrentTheme() ⇒ [<code>Theme</code>](#new_Theme_new)
Get current theme object that is loaded in the editor.

**Kind**: global function
**Returns**: [<code>Theme</code>](#new_Theme_new) - the current theme instance
<a name="getAllThemes"></a>

## getAllThemes() ⇒ [<code>Array.&lt;Theme&gt;</code>](#new_Theme_new)
Gets all available themes

**Kind**: global function
**Returns**: [<code>Array.&lt;Theme&gt;</code>](#new_Theme_new) - collection of all available themes
<a name="refresh"></a>

## refresh(force)
Refresh current theme in the editor

**Kind**: global function

| Param | Type | Description |
| --- | --- | --- |
| force | <code>boolean</code> | Forces a reload of the current theme. It reloads the theme file. |

<a name="loadFile"></a>

## loadFile(fileName, options) ⇒ <code>$.Promise</code>
Loads a theme from a file.

**Kind**: global function
**Returns**: <code>$.Promise</code> - promise object resolved with the theme to be loaded from fileName

| Param | Type | Description |
| --- | --- | --- |
| fileName | <code>string</code> | is the full path to the file to be opened |
| options | <code>Object</code> | is an optional parameter to specify metadata for the theme. |

<a name="loadPackage"></a>

## loadPackage(themePackage) ⇒ <code>$.Promise</code>
Loads a theme from an extension package.

**Kind**: global function
**Returns**: <code>$.Promise</code> - promise object resolved with the theme to be loaded from the pacakge

| Param | Type | Description |
| --- | --- | --- |
| themePackage | <code>Object</code> | is a package from the extension manager for the theme to be loaded. |

<a name="isOSInDarkTheme"></a>

## isOSInDarkTheme()
Detects if the os settings is set to dark theme or not

**Kind**: global function
<a name="setCurrentTheme"></a>

## setCurrentTheme(themeID) ⇒ <code>boolean</code>
Sets the current theme for the given theme id if present.

**Kind**: global function
**Returns**: <code>boolean</code> - true if the theme was applied, else false

| Param | Type |
| --- | --- |
| themeID | <code>string</code> |

70 changes: 70 additions & 0 deletions docs/API-Reference/view/ViewCommandHandlers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
### Import :
```js
const ViewCommandHandlers = brackets.getModule("view/ViewCommandHandlers")
```

<a name="Commands"></a>

## Commands
The ViewCommandHandlers object dispatches the following event(s):
- fontSizeChange -- Triggered when the font size is changed via the
Increase Font Size, Decrease Font Size, or Restore Font Size commands.
The 2nd arg to the listener is the amount of the change. The 3rd arg
is a string containing the new font size after applying the change.

**Kind**: global variable
<a name="validFontSizeRegExpStr"></a>

## validFontSizeRegExpStr
Font sizes should be validated by this regexp

**Kind**: global variable
<a name="setFontSize"></a>

## setFontSize(fontSize)
Font size setter to set the font size for the document editor

**Kind**: global function

| Param | Type | Description |
| --- | --- | --- |
| fontSize | <code>string</code> | The font size with size unit as 'px' or 'em' |

<a name="getFontSize"></a>

## getFontSize() ⇒ <code>string</code>
Font size getter to get the current font size for the document editor

**Kind**: global function
**Returns**: <code>string</code> - Font size with size unit as 'px' or 'em'
<a name="setFontFamily"></a>

## setFontFamily(fontFamily)
Font family setter to set the font family for the document editor

**Kind**: global function

| Param | Type | Description |
| --- | --- | --- |
| fontFamily | <code>string</code> | The font family to be set. It can be a string with multiple comma separated fonts |

<a name="getFontFamily"></a>

## getFontFamily() ⇒ <code>string</code>
Font family getter to get the currently configured font family for the document editor

**Kind**: global function
**Returns**: <code>string</code> - The font family for the document editor
<a name="restoreFontSize"></a>

## restoreFontSize()
Restores the font size using the saved style and migrates the old fontSizeAdjustment
view state to the new fontSize, when required

**Kind**: global function
<a name="restoreFonts"></a>

## restoreFonts()
Restores the font size and font family back to factory settings.

**Kind**: global function
Loading

0 comments on commit c215cdb

Please sign in to comment.