Skip to content

Commit

Permalink
chore: mark non-public APIs as @internal (#2100)
Browse files Browse the repository at this point in the history
* chore: mark non-public APIs as @internal

* change @internal to @docs-private
  • Loading branch information
jelbourn authored Dec 13, 2016
1 parent 8f1c5a9 commit 473752b
Show file tree
Hide file tree
Showing 37 changed files with 117 additions and 165 deletions.
2 changes: 1 addition & 1 deletion src/demo-app/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"outDir": "../../dist/",
"sourceMap": true,
"target": "es5",
"stripInternal": true,
"stripInternal": false,
"baseUrl": "",
"typeRoots": [
"../../node_modules/@types"
Expand Down
2 changes: 1 addition & 1 deletion src/e2e-app/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"outDir": "../../dist/",
"sourceMap": true,
"target": "es5",
"stripInternal": true,
"stripInternal": false,
"baseUrl": "",
"typeRoots": [
"../../node_modules/@types",
Expand Down
18 changes: 3 additions & 15 deletions src/lib/button-toggle/button-toggle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ export class MdButtonToggleGroup implements AfterViewInit, ControlValueAccessor
@ContentChildren(forwardRef(() => MdButtonToggle))
_buttonToggles: QueryList<MdButtonToggle> = null;

/** TODO: internal */
ngAfterViewInit() {
this._isInitialized = true;
}
Expand Down Expand Up @@ -199,26 +198,17 @@ export class MdButtonToggleGroup implements AfterViewInit, ControlValueAccessor
this._change.emit(event);
}

/**
* Implemented as part of ControlValueAccessor.
* TODO: internal
*/
/** Implemented as part of ControlValueAccessor. */
writeValue(value: any) {
this.value = value;
}

/**
* Implemented as part of ControlValueAccessor.
* TODO: internal
*/
/** Implemented as part of ControlValueAccessor. */
registerOnChange(fn: (value: any) => void) {
this._controlValueAccessorChangeFn = fn;
}

/**
* Implemented as part of ControlValueAccessor.
* TODO: internal
*/
/** Implemented as part of ControlValueAccessor. */
registerOnTouched(fn: any) {
this.onTouched = fn;
}
Expand Down Expand Up @@ -423,9 +413,7 @@ export class MdButtonToggle implements OnInit {
this._emitChangeEvent();
}

/** TODO: internal */
_onInputClick(event: Event) {

// We have to stop propagation for click events on the visual hidden input element.
// By default, when a user clicks on a label element, a generated click event will be
// dispatched on the associated input element. Since we are using a label element as our
Expand Down
19 changes: 4 additions & 15 deletions src/lib/checkbox/checkbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,33 +231,22 @@ export class MdCheckbox implements ControlValueAccessor {
return this.disableRipple || this.disabled;
}

/**
* Implemented as part of ControlValueAccessor.
* TODO: internal
*/
/** Implemented as part of ControlValueAccessor. */
writeValue(value: any) {
this.checked = !!value;
}

/**
* Implemented as part of ControlValueAccessor.
* TODO: internal
*/
/** Implemented as part of ControlValueAccessor. */
registerOnChange(fn: (value: any) => void) {
this._controlValueAccessorChangeFn = fn;
}

/**
* Implemented as part of ControlValueAccessor.
* TODO: internal
*/
/** Implemented as part of ControlValueAccessor. */
registerOnTouched(fn: any) {
this.onTouched = fn;
}

/**
* Implemented as a part of ControlValueAccessor.
*/
/** Implemented as a part of ControlValueAccessor. */
setDisabledState(isDisabled: boolean) {
this.disabled = isDisabled;
}
Expand Down
12 changes: 7 additions & 5 deletions src/lib/core/animation/animation.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
/** @docs-private */
export class AnimationCurves {
static STANDARD_CURVE = 'cubic-bezier(0.4,0.0,0.2,1)';
static DECELERATION_CURVE = 'cubic-bezier(0.0,0.0,0.2,1)';
static ACCELERATION_CURVE = 'cubic-bezier(0.4,0.0,1,1)';
static SHARP_CURVE = 'cubic-bezier(0.4,0.0,0.6,1)';
};
}


/** @docs-private */
export class AnimationDurations {
static COMPLEX = '375ms';
static ENTERING = '225ms';
static EXITING = '195ms';
};
static COMPLEX = '375ms';
static ENTERING = '225ms';
static EXITING = '195ms';
}
2 changes: 1 addition & 1 deletion src/lib/core/async/promise-completer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

/** @docs-private */
export class PromiseCompleter<R> {
promise: Promise<R>;
resolve: (value?: R | PromiseLike<R>) => void;
Expand Down
1 change: 1 addition & 0 deletions src/lib/core/errors/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

/**
* Wrapper around Error that sets the error message.
* @docs-private
*/
export class MdError extends Error {
constructor(value: string) {
Expand Down
5 changes: 4 additions & 1 deletion src/lib/core/line/line.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ import {DefaultStyleCompatibilityModeModule} from '../compatibility/default-mode
@Directive({ selector: '[md-line], [mat-line]' })
export class MdLine {}

/* Helper that takes a query list of lines and sets the correct class on the host */
/**
* Helper that takes a query list of lines and sets the correct class on the host.
* @docs-private
*/
export class MdLineSetter {
constructor(private _lines: QueryList<MdLine>, private _renderer: Renderer,
private _element: ElementRef) {
Expand Down
1 change: 0 additions & 1 deletion src/lib/core/overlay/overlay-directives.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ export class ConnectedOverlayDirective implements OnDestroy {
return this._dir ? this._dir.value : 'ltr';
}

/** TODO: internal */
ngOnDestroy() {
this._destroyOverlay();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export class ConnectedPositionStrategy implements PositionStrategy {
/**
* Updates the position of the overlay element, using whichever preferred position relative
* to the origin fits on-screen.
* TODO: internal
* @docs-private
*/
apply(element: HTMLElement): Promise<void> {
// We need the bounding rects for the origin and the overlay to determine how to position
Expand Down
2 changes: 1 addition & 1 deletion src/lib/core/overlay/position/global-position-strategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export class GlobalPositionStrategy implements PositionStrategy {

/**
* Apply the position to the element.
* TODO: internal
* @docs-private
*/
apply(element: HTMLElement): Promise<void> {
if (!this._wrapper) {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/core/overlay/position/viewport-ruler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {Injectable} from '@angular/core';

/**
* Simple utility for getting the bounds of the browser viewport.
* TODO: internal
* @docs-private
*/
@Injectable()
export class ViewportRuler {
Expand Down
1 change: 1 addition & 0 deletions src/lib/core/platform/platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const hasV8BreakIterator = (window.Intl && (window.Intl as any).v8BreakIterator)
/**
* Service to detect the current platform by comparing the userAgent strings and
* checking browser-specific global properties.
* @docs-private
*/
@Injectable()
export class MdPlatform {
Expand Down
30 changes: 24 additions & 6 deletions src/lib/core/portal/portal-errors.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,39 @@
import {MdError} from '../errors/error';

/** Exception thrown when attempting to attach a null portal to a host. */
/**
* Exception thrown when attempting to attach a null portal to a host.
* @docs-private
*/
export class MdNullPortalError extends MdError {
constructor() {
super('Must provide a portal to attach');
}
}

/** Exception thrown when attempting to attach a portal to a host that is already attached. */
/**
* Exception thrown when attempting to attach a portal to a host that is already attached.
* @docs-private
*/
export class MdPortalAlreadyAttachedError extends MdError {
constructor() {
super('Host already has a portal attached');
}
}

/** Exception thrown when attempting to attach a portal to an already-disposed host. */
/**
* Exception thrown when attempting to attach a portal to an already-disposed host.
* @docs-private
*/
export class MdPortalHostAlreadyDisposedError extends MdError {
constructor() {
super('This PortalHost has already been disposed');
}
}

/** Exception thrown when attempting to attach an unknown portal type. */
/**
* Exception thrown when attempting to attach an unknown portal type.
* @docs-private
*/
export class MdUnknownPortalTypeError extends MdError {
constructor() {
super(
Expand All @@ -30,14 +42,20 @@ export class MdUnknownPortalTypeError extends MdError {
}
}

/** Exception thrown when attempting to attach a portal to a null host. */
/**
* Exception thrown when attempting to attach a portal to a null host.
* @docs-private
*/
export class MdNullPortalHostError extends MdError {
constructor() {
super('Attempting to attach a portal to a null PortalHost');
}
}

/** Exception thrown when attempting to detach a portal that is not attached. */
/**
* Exception thrown when attempting to detach a portal that is not attached.
* @docs-private
*/
export class MdNoPortalAttachedError extends MdError {
constructor() {
super('Attempting to detach a portal that is not attached to a host');
Expand Down
4 changes: 3 additions & 1 deletion src/lib/core/projection/projection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function _replaceWith(toReplaceEl: HTMLElement, otherEl: HTMLElement) {
toReplaceEl.parentElement.replaceChild(otherEl, toReplaceEl);
}


/** @docs-private */
@Directive({
selector: 'dom-projection-host'
})
Expand All @@ -16,6 +16,7 @@ export class DomProjectionHost {
}


/** @docs-private */
@Injectable()
export class DomProjection {
/**
Expand Down Expand Up @@ -73,6 +74,7 @@ export class DomProjection {
}


/** @docs-private */
@NgModule({
exports: [DomProjectionHost],
declarations: [DomProjectionHost],
Expand Down
6 changes: 3 additions & 3 deletions src/lib/core/ripple/ripple-renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
NgZone,
} from '@angular/core';

/** TODO: internal */
/** @docs-private */
export enum ForegroundRippleState {
NEW,
EXPANDING,
Expand All @@ -12,7 +12,7 @@ export enum ForegroundRippleState {

/**
* Wrapper for a foreground ripple DOM element and its animation state.
* TODO: internal
* @docs-private
*/
export class ForegroundRipple {
state = ForegroundRippleState.NEW;
Expand All @@ -37,7 +37,7 @@ const distanceToFurthestCorner = (x: number, y: number, rect: ClientRect) => {
* The constructor takes a reference to the ripple directive's host element and a map of DOM
* event handlers to be installed on the element that triggers ripple animations.
* This will eventually become a custom renderer once Angular support exists.
* TODO: internal
* @docs-private
*/
export class RippleRenderer {
private _backgroundDiv: HTMLElement;
Expand Down
3 changes: 0 additions & 3 deletions src/lib/core/ripple/ripple.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ export class MdRipple implements OnInit, OnDestroy, OnChanges {
this._ruler = _ruler;
}

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

/** TODO: internal */
ngOnDestroy() {
// Remove event listeners on the trigger element.
this._rippleRenderer.clearTriggerElement();
}

/** TODO: internal */
ngOnChanges(changes: { [propertyName: string]: SimpleChange }) {
// If the trigger element changed (or is being initially set), add event listeners to it.
const changedInputs = Object.keys(changes);
Expand Down
1 change: 1 addition & 0 deletions src/lib/dialog/dialog-container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import 'rxjs/add/operator/first';

/**
* Internal component that wraps user-provided dialog content.
* @docs-private
*/
@Component({
moduleId: module.id,
Expand Down
3 changes: 3 additions & 0 deletions src/lib/grid-list/grid-list-errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {MdError} from '../core';

/**
* Exception thrown when cols property is missing from grid-list
* @docs-private
*/
export class MdGridListColsError extends MdError {
constructor() {
Expand All @@ -11,6 +12,7 @@ export class MdGridListColsError extends MdError {

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

/**
* Exception thrown when an invalid ratio is passed in as a rowHeight
* @docs-private
*/
export class MdGridListBadRatioError extends MdError {
constructor(value: string) {
Expand Down
4 changes: 2 additions & 2 deletions src/lib/grid-list/grid-list-measure.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@

/**
* Converts values into strings. Falsy values become empty strings.
* TODO: internal
* @docs-private
*/
export function coerceToString(value: string | number): string {
return `${value || ''}`;
}

/**
* Converts a value that might be a string into a number.
* TODO: internal
* @docs-private
*/
export function coerceToNumber(value: string | number): number {
return typeof value === 'string' ? parseInt(value, 10) : value;
Expand Down
Loading

0 comments on commit 473752b

Please sign in to comment.