Skip to content

Commit 473752b

Browse files
authored
chore: mark non-public APIs as @internal (#2100)
* chore: mark non-public APIs as @internal * change @internal to @docs-private
1 parent 8f1c5a9 commit 473752b

37 files changed

+117
-165
lines changed

src/demo-app/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"outDir": "../../dist/",
1313
"sourceMap": true,
1414
"target": "es5",
15-
"stripInternal": true,
15+
"stripInternal": false,
1616
"baseUrl": "",
1717
"typeRoots": [
1818
"../../node_modules/@types"

src/e2e-app/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"outDir": "../../dist/",
1313
"sourceMap": true,
1414
"target": "es5",
15-
"stripInternal": true,
15+
"stripInternal": false,
1616
"baseUrl": "",
1717
"typeRoots": [
1818
"../../node_modules/@types",

src/lib/button-toggle/button-toggle.ts

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ export class MdButtonToggleGroup implements AfterViewInit, ControlValueAccessor
9797
@ContentChildren(forwardRef(() => MdButtonToggle))
9898
_buttonToggles: QueryList<MdButtonToggle> = null;
9999

100-
/** TODO: internal */
101100
ngAfterViewInit() {
102101
this._isInitialized = true;
103102
}
@@ -199,26 +198,17 @@ export class MdButtonToggleGroup implements AfterViewInit, ControlValueAccessor
199198
this._change.emit(event);
200199
}
201200

202-
/**
203-
* Implemented as part of ControlValueAccessor.
204-
* TODO: internal
205-
*/
201+
/** Implemented as part of ControlValueAccessor. */
206202
writeValue(value: any) {
207203
this.value = value;
208204
}
209205

210-
/**
211-
* Implemented as part of ControlValueAccessor.
212-
* TODO: internal
213-
*/
206+
/** Implemented as part of ControlValueAccessor. */
214207
registerOnChange(fn: (value: any) => void) {
215208
this._controlValueAccessorChangeFn = fn;
216209
}
217210

218-
/**
219-
* Implemented as part of ControlValueAccessor.
220-
* TODO: internal
221-
*/
211+
/** Implemented as part of ControlValueAccessor. */
222212
registerOnTouched(fn: any) {
223213
this.onTouched = fn;
224214
}
@@ -423,9 +413,7 @@ export class MdButtonToggle implements OnInit {
423413
this._emitChangeEvent();
424414
}
425415

426-
/** TODO: internal */
427416
_onInputClick(event: Event) {
428-
429417
// We have to stop propagation for click events on the visual hidden input element.
430418
// By default, when a user clicks on a label element, a generated click event will be
431419
// dispatched on the associated input element. Since we are using a label element as our

src/lib/checkbox/checkbox.ts

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -231,33 +231,22 @@ export class MdCheckbox implements ControlValueAccessor {
231231
return this.disableRipple || this.disabled;
232232
}
233233

234-
/**
235-
* Implemented as part of ControlValueAccessor.
236-
* TODO: internal
237-
*/
234+
/** Implemented as part of ControlValueAccessor. */
238235
writeValue(value: any) {
239236
this.checked = !!value;
240237
}
241238

242-
/**
243-
* Implemented as part of ControlValueAccessor.
244-
* TODO: internal
245-
*/
239+
/** Implemented as part of ControlValueAccessor. */
246240
registerOnChange(fn: (value: any) => void) {
247241
this._controlValueAccessorChangeFn = fn;
248242
}
249243

250-
/**
251-
* Implemented as part of ControlValueAccessor.
252-
* TODO: internal
253-
*/
244+
/** Implemented as part of ControlValueAccessor. */
254245
registerOnTouched(fn: any) {
255246
this.onTouched = fn;
256247
}
257248

258-
/**
259-
* Implemented as a part of ControlValueAccessor.
260-
*/
249+
/** Implemented as a part of ControlValueAccessor. */
261250
setDisabledState(isDisabled: boolean) {
262251
this.disabled = isDisabled;
263252
}

src/lib/core/animation/animation.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1+
/** @docs-private */
12
export class AnimationCurves {
23
static STANDARD_CURVE = 'cubic-bezier(0.4,0.0,0.2,1)';
34
static DECELERATION_CURVE = 'cubic-bezier(0.0,0.0,0.2,1)';
45
static ACCELERATION_CURVE = 'cubic-bezier(0.4,0.0,1,1)';
56
static SHARP_CURVE = 'cubic-bezier(0.4,0.0,0.6,1)';
6-
};
7+
}
78

89

10+
/** @docs-private */
911
export class AnimationDurations {
10-
static COMPLEX = '375ms';
11-
static ENTERING = '225ms';
12-
static EXITING = '195ms';
13-
};
12+
static COMPLEX = '375ms';
13+
static ENTERING = '225ms';
14+
static EXITING = '195ms';
15+
}

src/lib/core/async/promise-completer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1+
/** @docs-private */
22
export class PromiseCompleter<R> {
33
promise: Promise<R>;
44
resolve: (value?: R | PromiseLike<R>) => void;

src/lib/core/errors/error.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
/**
44
* Wrapper around Error that sets the error message.
5+
* @docs-private
56
*/
67
export class MdError extends Error {
78
constructor(value: string) {

src/lib/core/line/line.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ import {DefaultStyleCompatibilityModeModule} from '../compatibility/default-mode
1616
@Directive({ selector: '[md-line], [mat-line]' })
1717
export class MdLine {}
1818

19-
/* Helper that takes a query list of lines and sets the correct class on the host */
19+
/**
20+
* Helper that takes a query list of lines and sets the correct class on the host.
21+
* @docs-private
22+
*/
2023
export class MdLineSetter {
2124
constructor(private _lines: QueryList<MdLine>, private _renderer: Renderer,
2225
private _element: ElementRef) {

src/lib/core/overlay/overlay-directives.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@ export class ConnectedOverlayDirective implements OnDestroy {
160160
return this._dir ? this._dir.value : 'ltr';
161161
}
162162

163-
/** TODO: internal */
164163
ngOnDestroy() {
165164
this._destroyOverlay();
166165
}

src/lib/core/overlay/position/connected-position-strategy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export class ConnectedPositionStrategy implements PositionStrategy {
6666
/**
6767
* Updates the position of the overlay element, using whichever preferred position relative
6868
* to the origin fits on-screen.
69-
* TODO: internal
69+
* @docs-private
7070
*/
7171
apply(element: HTMLElement): Promise<void> {
7272
// We need the bounding rects for the origin and the overlay to determine how to position

src/lib/core/overlay/position/global-position-strategy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export class GlobalPositionStrategy implements PositionStrategy {
101101

102102
/**
103103
* Apply the position to the element.
104-
* TODO: internal
104+
* @docs-private
105105
*/
106106
apply(element: HTMLElement): Promise<void> {
107107
if (!this._wrapper) {

src/lib/core/overlay/position/viewport-ruler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {Injectable} from '@angular/core';
44

55
/**
66
* Simple utility for getting the bounds of the browser viewport.
7-
* TODO: internal
7+
* @docs-private
88
*/
99
@Injectable()
1010
export class ViewportRuler {

src/lib/core/platform/platform.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const hasV8BreakIterator = (window.Intl && (window.Intl as any).v8BreakIterator)
99
/**
1010
* Service to detect the current platform by comparing the userAgent strings and
1111
* checking browser-specific global properties.
12+
* @docs-private
1213
*/
1314
@Injectable()
1415
export class MdPlatform {

src/lib/core/portal/portal-errors.ts

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,39 @@
11
import {MdError} from '../errors/error';
22

3-
/** Exception thrown when attempting to attach a null portal to a host. */
3+
/**
4+
* Exception thrown when attempting to attach a null portal to a host.
5+
* @docs-private
6+
*/
47
export class MdNullPortalError extends MdError {
58
constructor() {
69
super('Must provide a portal to attach');
710
}
811
}
912

10-
/** Exception thrown when attempting to attach a portal to a host that is already attached. */
13+
/**
14+
* Exception thrown when attempting to attach a portal to a host that is already attached.
15+
* @docs-private
16+
*/
1117
export class MdPortalAlreadyAttachedError extends MdError {
1218
constructor() {
1319
super('Host already has a portal attached');
1420
}
1521
}
1622

17-
/** Exception thrown when attempting to attach a portal to an already-disposed host. */
23+
/**
24+
* Exception thrown when attempting to attach a portal to an already-disposed host.
25+
* @docs-private
26+
*/
1827
export class MdPortalHostAlreadyDisposedError extends MdError {
1928
constructor() {
2029
super('This PortalHost has already been disposed');
2130
}
2231
}
2332

24-
/** Exception thrown when attempting to attach an unknown portal type. */
33+
/**
34+
* Exception thrown when attempting to attach an unknown portal type.
35+
* @docs-private
36+
*/
2537
export class MdUnknownPortalTypeError extends MdError {
2638
constructor() {
2739
super(
@@ -30,14 +42,20 @@ export class MdUnknownPortalTypeError extends MdError {
3042
}
3143
}
3244

33-
/** Exception thrown when attempting to attach a portal to a null host. */
45+
/**
46+
* Exception thrown when attempting to attach a portal to a null host.
47+
* @docs-private
48+
*/
3449
export class MdNullPortalHostError extends MdError {
3550
constructor() {
3651
super('Attempting to attach a portal to a null PortalHost');
3752
}
3853
}
3954

40-
/** Exception thrown when attempting to detach a portal that is not attached. */
55+
/**
56+
* Exception thrown when attempting to detach a portal that is not attached.
57+
* @docs-private
58+
*/
4159
export class MdNoPortalAttachedError extends MdError {
4260
constructor() {
4361
super('Attempting to detach a portal that is not attached to a host');

src/lib/core/projection/projection.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ function _replaceWith(toReplaceEl: HTMLElement, otherEl: HTMLElement) {
77
toReplaceEl.parentElement.replaceChild(otherEl, toReplaceEl);
88
}
99

10-
10+
/** @docs-private */
1111
@Directive({
1212
selector: 'dom-projection-host'
1313
})
@@ -16,6 +16,7 @@ export class DomProjectionHost {
1616
}
1717

1818

19+
/** @docs-private */
1920
@Injectable()
2021
export class DomProjection {
2122
/**
@@ -73,6 +74,7 @@ export class DomProjection {
7374
}
7475

7576

77+
/** @docs-private */
7678
@NgModule({
7779
exports: [DomProjectionHost],
7880
declarations: [DomProjectionHost],

src/lib/core/ripple/ripple-renderer.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {
33
NgZone,
44
} from '@angular/core';
55

6-
/** TODO: internal */
6+
/** @docs-private */
77
export enum ForegroundRippleState {
88
NEW,
99
EXPANDING,
@@ -12,7 +12,7 @@ export enum ForegroundRippleState {
1212

1313
/**
1414
* Wrapper for a foreground ripple DOM element and its animation state.
15-
* TODO: internal
15+
* @docs-private
1616
*/
1717
export class ForegroundRipple {
1818
state = ForegroundRippleState.NEW;
@@ -37,7 +37,7 @@ const distanceToFurthestCorner = (x: number, y: number, rect: ClientRect) => {
3737
* The constructor takes a reference to the ripple directive's host element and a map of DOM
3838
* event handlers to be installed on the element that triggers ripple animations.
3939
* This will eventually become a custom renderer once Angular support exists.
40-
* TODO: internal
40+
* @docs-private
4141
*/
4242
export class RippleRenderer {
4343
private _backgroundDiv: HTMLElement;

src/lib/core/ripple/ripple.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ export class MdRipple implements OnInit, OnDestroy, OnChanges {
7575
this._ruler = _ruler;
7676
}
7777

78-
/** TODO: internal */
7978
ngOnInit() {
8079
// If no trigger element was explicity set, use the host element
8180
if (!this.trigger) {
@@ -86,13 +85,11 @@ export class MdRipple implements OnInit, OnDestroy, OnChanges {
8685
}
8786
}
8887

89-
/** TODO: internal */
9088
ngOnDestroy() {
9189
// Remove event listeners on the trigger element.
9290
this._rippleRenderer.clearTriggerElement();
9391
}
9492

95-
/** TODO: internal */
9693
ngOnChanges(changes: { [propertyName: string]: SimpleChange }) {
9794
// If the trigger element changed (or is being initially set), add event listeners to it.
9895
const changedInputs = Object.keys(changes);

src/lib/dialog/dialog-container.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import 'rxjs/add/operator/first';
1616

1717
/**
1818
* Internal component that wraps user-provided dialog content.
19+
* @docs-private
1920
*/
2021
@Component({
2122
moduleId: module.id,

src/lib/grid-list/grid-list-errors.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import {MdError} from '../core';
22

33
/**
44
* Exception thrown when cols property is missing from grid-list
5+
* @docs-private
56
*/
67
export class MdGridListColsError extends MdError {
78
constructor() {
@@ -11,6 +12,7 @@ export class MdGridListColsError extends MdError {
1112

1213
/**
1314
* Exception thrown when a tile's colspan is longer than the number of cols in list
15+
* @docs-private
1416
*/
1517
export class MdGridTileTooWideError extends MdError {
1618
constructor(cols: number, listLength: number) {
@@ -20,6 +22,7 @@ export class MdGridTileTooWideError extends MdError {
2022

2123
/**
2224
* Exception thrown when an invalid ratio is passed in as a rowHeight
25+
* @docs-private
2326
*/
2427
export class MdGridListBadRatioError extends MdError {
2528
constructor(value: string) {

src/lib/grid-list/grid-list-measure.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11

22
/**
33
* Converts values into strings. Falsy values become empty strings.
4-
* TODO: internal
4+
* @docs-private
55
*/
66
export function coerceToString(value: string | number): string {
77
return `${value || ''}`;
88
}
99

1010
/**
1111
* Converts a value that might be a string into a number.
12-
* TODO: internal
12+
* @docs-private
1313
*/
1414
export function coerceToNumber(value: string | number): number {
1515
return typeof value === 'string' ? parseInt(value, 10) : value;

0 commit comments

Comments
 (0)