Skip to content

Commit 8f3a025

Browse files
mmalerbajelbourn
authored andcommitted
docs: add jsdoc to public interfaces (#8568)
1 parent 40d6bcb commit 8f3a025

File tree

16 files changed

+65
-6
lines changed

16 files changed

+65
-6
lines changed

src/cdk/a11y/activedescendant-key-manager.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ import {ListKeyManager, ListKeyManagerOption} from './list-key-manager';
1414
* currently disabled.
1515
*/
1616
export interface Highlightable extends ListKeyManagerOption {
17+
/** Applies the styles for an active item to this item. */
1718
setActiveStyles(): void;
19+
20+
/** Applies the styles for an inactive item to this item. */
1821
setInactiveStyles(): void;
1922
}
2023

src/cdk/a11y/aria-describer.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,13 @@ import {addAriaReferencedId, getAriaReferenceIds, removeAriaReferencedId} from '
1212

1313
/**
1414
* Interface used to register message elements and keep a count of how many registrations have
15-
* the same message and the reference to the message element used for the aria-describedby.
15+
* the same message and the reference to the message element used for the `aria-describedby`.
1616
*/
1717
export interface RegisteredMessage {
18+
/** The element containing the message. */
1819
messageElement: Element;
20+
21+
/** The number of elements that reference this message element via `aria-describedby`. */
1922
referenceCount: number;
2023
}
2124

src/cdk/a11y/focus-key-manager.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {ListKeyManager, ListKeyManagerOption} from './list-key-manager';
1414
* and be able to supply it's label.
1515
*/
1616
export interface FocusableOption extends ListKeyManagerOption {
17+
/** Focuses the `FocusableOption`. */
1718
focus(): void;
1819
}
1920

src/cdk/a11y/list-key-manager.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ import {tap} from 'rxjs/operators/tap';
1717

1818
/** This interface is for items that can be passed to a ListKeyManager. */
1919
export interface ListKeyManagerOption {
20+
/** Whether the option is disabled. */
2021
disabled?: boolean;
22+
23+
/** Gets the label for this option. */
2124
getLabel?(): string;
2225
}
2326

src/cdk/collections/collection-viewer.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,9 @@ import {Observable} from 'rxjs/Observable';
1313
* information regarding the view and any changes made.
1414
*/
1515
export interface CollectionViewer {
16+
/**
17+
* A stream that emits whenever the `CollectionViewer` starts looking at a new portion of the
18+
* data. The `start` index is inclusive, while the `end` is exclusive.
19+
*/
1620
viewChange: Observable<{start: number, end: number}>;
1721
}

src/cdk/layout/breakpoints-observer.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import {fromEventPattern} from 'rxjs/observable/fromEventPattern';
1818

1919
/** The current state of a layout breakpoint. */
2020
export interface BreakpointState {
21+
/** Whether the breakpoint is currently matching. */
2122
matches: boolean;
2223
}
2324

src/cdk/overlay/scroll/scroll-strategy.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,16 @@
99
import {OverlayRef} from '../overlay-ref';
1010

1111
/**
12-
* Describes a strategy that will be used by an overlay
13-
* to handle scroll events while it is open.
12+
* Describes a strategy that will be used by an overlay to handle scroll events while it is open.
1413
*/
1514
export interface ScrollStrategy {
15+
/** Enable this scroll strategy (called when the attached overlay is attached to a portal). */
1616
enable: () => void;
17+
18+
/** Disable this scroll strategy (called when the attached overlay is detached from a portal). */
1719
disable: () => void;
20+
21+
/** Attaches this `ScrollStrategy` to an overlay. */
1822
attach: (overlayRef: OverlayRef) => void;
1923
}
2024

src/cdk/portal/portal.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,16 +146,18 @@ export class TemplatePortal<C> extends Portal<C> {
146146
}
147147

148148

149-
/**
150-
* A `PortalOutlet` is an space that can contain a single `Portal`.
151-
*/
149+
/** A `PortalOutlet` is an space that can contain a single `Portal`. */
152150
export interface PortalOutlet {
151+
/** Attaches a portal to this outlet. */
153152
attach(portal: Portal<any>): any;
154153

154+
/** Detaches the currently attached portal from this outlet. */
155155
detach(): any;
156156

157+
/** Performs cleanup before the outlet is destroyed. */
157158
dispose(): void;
158159

160+
/** Whether there is currently a portal attached to this outlet. */
159161
hasAttached(): boolean;
160162
}
161163

src/lib/chips/chip-input.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,12 @@ import {Directive, ElementRef, EventEmitter, Input, Output} from '@angular/core'
1212
import {MatChipList} from './chip-list';
1313

1414

15+
/** Represents an input event on a `matChipInput`. */
1516
export interface MatChipInputEvent {
17+
/** The native `<input>` element that the event is being fired for. */
1618
input: HTMLInputElement;
19+
20+
/** The value of the input. */
1721
value: string;
1822
}
1923

src/lib/chips/chip.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ import {CanColor, CanDisable, mixinColor, mixinDisabled} from '@angular/material
2222
import {Subject} from 'rxjs/Subject';
2323

2424

25+
/** Represents an event fired on an individual `mat-chip`. */
2526
export interface MatChipEvent {
27+
/** The chip the event was fired on. */
2628
chip: MatChip;
2729
}
2830

src/lib/core/placeholder/placeholder-options.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ export const MAT_PLACEHOLDER_GLOBAL_OPTIONS =
1515
/** Type for the available floatPlaceholder values. */
1616
export type FloatPlaceholderType = 'always' | 'never' | 'auto';
1717

18+
/** Configurable options for floating placeholders. */
1819
export interface PlaceholderOptions {
20+
/**
21+
* Whether the placeholder should float `always`, `never`, or `auto` (only when necessary).
22+
* Default behavior is assumed to be `auto`.
23+
*/
1924
float?: FloatPlaceholderType;
2025
}

src/lib/core/ripple/ripple.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import {Platform} from '@angular/cdk/platform';
2222
import {RippleConfig, RippleRenderer} from './ripple-renderer';
2323
import {RippleRef} from './ripple-ref';
2424

25+
/** Configurable options for `matRipple`. */
2526
export interface RippleGlobalOptions {
2627
/**
2728
* Whether ripples should be disabled. Ripples can be still launched manually by using

src/lib/dialog/dialog-config.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,16 @@ export type DialogRole = 'dialog' | 'alertdialog';
1414

1515
/** Possible overrides for a dialog's position. */
1616
export interface DialogPosition {
17+
/** Override for the dialog's top position. */
1718
top?: string;
19+
20+
/** Override for the dialog's bottom position. */
1821
bottom?: string;
22+
23+
/** Override for the dialog's left position. */
1924
left?: string;
25+
26+
/** Override for the dialog's right position. */
2027
right?: string;
2128
}
2229

src/lib/menu/menu-directive.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,13 @@ import {coerceBooleanProperty} from '@angular/cdk/coercion';
4444

4545
/** Default `mat-menu` options that can be overridden. */
4646
export interface MatMenuDefaultOptions {
47+
/** The x-axis position of the menu. */
4748
xPosition: MenuPositionX;
49+
50+
/** The y-axis position of the menu. */
4851
yPosition: MenuPositionY;
52+
53+
/** Whether the menu should overlap the menu trigger. */
4954
overlapTrigger: boolean;
5055
}
5156

src/lib/menu/menu-panel.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ import {EventEmitter, TemplateRef} from '@angular/core';
1010
import {MenuPositionX, MenuPositionY} from './menu-positions';
1111
import {Direction} from '@angular/cdk/bidi';
1212

13+
/**
14+
* Interface for a custom menu panel that can be used with `matMenuTriggerFor`.
15+
* @docs-private
16+
*/
1317
export interface MatMenuPanel {
1418
xPosition: MenuPositionX;
1519
yPosition: MenuPositionY;

src/lib/sort/sort.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,24 @@ import {
1515
getSortHeaderMissingIdError
1616
} from './sort-errors';
1717

18+
/** Interface for a directive that holds sorting state consumed by `MatSortHeader`. */
1819
export interface MatSortable {
20+
/** The id of the column being sorted. */
1921
id: string;
22+
23+
/** Starting sort direction. */
2024
start: 'asc' | 'desc';
25+
26+
/** Whether to disable clearing the sorting state. */
2127
disableClear: boolean;
2228
}
2329

30+
/** The current sort state. */
2431
export interface Sort {
32+
/** The id of the column being sorted. */
2533
active: string;
34+
35+
/** The sort direction. */
2636
direction: SortDirection;
2737
}
2838

0 commit comments

Comments
 (0)