Skip to content

Commit

Permalink
fix: normalized ts
Browse files Browse the repository at this point in the history
  • Loading branch information
asnowwolf committed Dec 7, 2023
1 parent 35a7b2e commit cb1922f
Show file tree
Hide file tree
Showing 325 changed files with 2,219 additions and 1,451 deletions.
2 changes: 1 addition & 1 deletion packages/animations/src/animation_builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {AnimationPlayer} from './players/animation_player';
* do need to, follow these steps:
*
* 1. Use the <code>[AnimationBuilder.build](api/animations/AnimationBuilder#build)()</code> method
* to create a programmatic animation. The method returns an `AnimationFactory` instance.
* to create a programmatic animation. The method returns an `AnimationFactory` instance.
*
* 2. Use the factory object to create an `AnimationPlayer` and attach it to a DOM element.
*
Expand Down
278 changes: 143 additions & 135 deletions packages/animations/src/animation_metadata.ts

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const skipComment = '// @ng_package: ignore-cross-repo-import';
* Such imports are flagged and will be returned in the failure list. Cross
* entry-point or package imports result in duplicate code and therefore are
* forbidden (unless explicitly opted out via comment - {@link skipComment}).
*
*/
export function analyzeFileAndEnsureNoCrossImports(
file: BazelFileInfo, pkg: PackageMetadata): string[] {
Expand Down
2 changes: 2 additions & 0 deletions packages/benchpress/src/sampler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ import {WebDriverAdapter} from './web_driver_adapter';

/**
* The Sampler owns the sample loop:
*
* 1. calls the prepare/execute callbacks,
* 2. gets data from the metric
* 3. asks the validator for a valid sample
* 4. reports the new data to the reporter
* 5. loop until there is a valid sample
*
*/
@Injectable()
export class Sampler {
Expand Down
6 changes: 4 additions & 2 deletions packages/benchpress/src/web_driver_extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export abstract class WebDriverExtension {

/**
* Format:
*
* - cat: category of the event
* - name: event name: 'script', 'gc', 'render', ...
* - ph: phase: 'B' (begin), 'E' (end), 'X' (Complete event), 'I' (Instant event)
Expand All @@ -83,8 +84,9 @@ export abstract class WebDriverExtension {
* - args: arguments, e.g. {heapSize: 1234}
*
* Based on [Chrome Trace Event
*Format](https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU/edit)
**/
* Format](https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU/edit)
*
*/
readPerfLog(): Promise<PerfLogEvent[]> {
throw new Error('NYI');
}
Expand Down
32 changes: 18 additions & 14 deletions packages/common/http/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,10 @@ function addBody<T>(
* single data type of the response.
* A single overload version of the method handles each response type.
* The value of `responseType` cannot be a union, as the combined signature could imply.
*
*
* @usageNotes
*
* Sample HTTP requests for the [Tour of Heroes](/tutorial/tour-of-heroes/toh-pt0) application.
*
* ### HTTP Request Example
Expand All @@ -82,19 +83,21 @@ function addBody<T>(
*
* Alternatively, the parameter string can be used without invoking HttpParams
* by directly joining to the URL.
*
* ```
* this.httpClient.request('GET', this.heroesUrl + '?' + 'name=term', {responseType:'json'});
* ```
*
*
* ### JSONP Example
*
* ```
* requestJsonp(url, callback = 'callback') {
* return this.httpClient.jsonp(this.heroesURL, callback);
* }
* ```
*
* ### PATCH Example
*
* ```
* // PATCH one of the heroes' name
* patchHero (id: number, heroName: string): Observable<{}> {
Expand All @@ -106,7 +109,6 @@ function addBody<T>(
*
* @see [HTTP Guide](guide/understanding-communicating-with-http)
* @see [HTTP Request](api/common/http/HttpRequest)
*
* @publicApi
*/
@Injectable()
Expand Down Expand Up @@ -486,18 +488,20 @@ export class HttpClient {
* a URL string as the second, and an options hash containing the request body as the third.
* See `addBody()`. In this case, the specified `responseType` and `observe` options determine the
* type of returned observable.
* * The `responseType` value determines how a successful response body is parsed.
* * If `responseType` is the default `json`, you can pass a type interface for the resulting
* object as a type parameter to the call.
*
* - The `responseType` value determines how a successful response body is parsed.
* - If `responseType` is the default `json`, you can pass a type interface for the resulting
* object as a type parameter to the call.
*
* The `observe` value determines the return type, according to what you are interested in
* observing.
* * An `observe` value of events returns an observable of the raw `HttpEvent` stream, including
* progress events by default.
* * An `observe` value of response returns an observable of `HttpResponse<T>`,
* where the `T` parameter depends on the `responseType` and any optionally provided type
* parameter.
* * An `observe` value of body returns an observable of `<T>` with the same `T` body type.
*
* - An `observe` value of events returns an observable of the raw `HttpEvent` stream, including
* progress events by default.
* - An `observe` value of response returns an observable of `HttpResponse<T>`,
* where the `T` parameter depends on the `responseType` and any optionally provided type
* parameter.
* - An `observe` value of body returns an observable of `<T>` with the same `T` body type.
*
*/
request(first: string|HttpRequest<any>, url?: string, options: {
Expand Down Expand Up @@ -2861,9 +2865,9 @@ export class HttpClient {
* @param url The endpoint URL.
* @param body The resources to add/update.
* @param options HTTP options
*
* @return An `Observable` of the `HttpResponse` for the request, with a response body
* of type 'Object`.
* of type `Object`.
*
*/
put(url: string, body: any|null, options: {
headers?: HttpHeaders|{[header: string]: string | string[]}, observe: 'response',
Expand Down
5 changes: 4 additions & 1 deletion packages/common/http/src/interceptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,10 @@ export type HttpHandlerFn = (req: HttpRequest<unknown>) => Observable<HttpEvent<
*
* @see [HTTP Guide](guide/http-intercept-requests-and-responses)
* @see {@link withInterceptors}
*
* @usageNotes
*
* Here is a noop interceptor that passes the request through without modifying it:
*
* ```typescript
* export const noopInterceptor: HttpInterceptorFn = (req: HttpRequest<unknown>, next:
* HttpHandlerFn) => {
Expand All @@ -108,6 +109,7 @@ export type HttpHandlerFn = (req: HttpRequest<unknown>) => Observable<HttpEvent<
* `next()` handler function.
*
* Here is a basic interceptor that adds a bearer token to the headers
*
* ```typescript
* export const authenticationInterceptor: HttpInterceptorFn = (req: HttpRequest<unknown>, next:
* HttpHandlerFn) => {
Expand All @@ -118,6 +120,7 @@ export type HttpHandlerFn = (req: HttpRequest<unknown>) => Observable<HttpEvent<
* return next(modifiedReq);
* };
* ```
*
*/
export type HttpInterceptorFn = (req: HttpRequest<unknown>, next: HttpHandlerFn) =>
Observable<HttpEvent<unknown>>;
Expand Down
1 change: 1 addition & 0 deletions packages/common/http/src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export class HttpClientXsrfModule {
* Configure XSRF protection.
* @param options An object that can specify either or both
* cookie name or header name.
*
* - Cookie name default is `XSRF-TOKEN`.
* - Header name default is `X-XSRF-TOKEN`.
*
Expand Down
5 changes: 4 additions & 1 deletion packages/common/locales/generate-locales-tool/day-periods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ export function getDayPeriods(localeData: CldrLocaleData, dayPeriodsList: string

/**
* Returns day period rules for a locale
* @returns string[]
* @returns
*
* string\[]
*
*/
export function getDayPeriodRules(
localeData: CldrLocaleData,
Expand Down
9 changes: 5 additions & 4 deletions packages/common/src/directives/ng_class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ const EMPTY_ARRAY: string[] = [];
/**
* Represents internal object used to track state of each CSS class. There are 3 different (boolean)
* flags that, combined together, indicate state of a given CSS class:
*
* - enabled: indicates if a class should be present in the DOM (true) or not (false);
* - changed: tracks if a class was toggled (added or removed) during the custom dirty-checking
* process; changed classes must be synchronized with the DOM;
* process; changed classes must be synchronized with the DOM;
* - touched: tracks if a class is present in the current object bound to the class / ngClass input;
* classes that are not present any more can be removed from the internal data structures;
* classes that are not present any more can be removed from the internal data structures;
*
*/
interface CssClassState {
// PERF: could use a bit mask to represent state as all fields are boolean flags
Expand All @@ -31,7 +33,6 @@ interface CssClassState {

/**
* @ngModule CommonModule
*
* @usageNotes
* ```
* <some-element [ngClass]="'first second'">...</some-element>
Expand All @@ -44,12 +45,12 @@ interface CssClassState {
*
* <some-element [ngClass]="{'class1 class2 class3' : true}">...</some-element>
* ```
*
* @description
*
* Adds and removes CSS classes on an HTML element.
*
* The CSS classes are updated as follows, depending on the type of the expression evaluation:
*
* - `string` - the CSS classes listed in the string (space delimited) are added,
* - `Array` - the CSS classes declared as Array elements are added,
* - `Object` - keys are CSS classes that get added when the expression given in the value
Expand Down
16 changes: 10 additions & 6 deletions packages/common/src/directives/ng_component_outlet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,36 +22,39 @@ import {ComponentRef, createNgModule, Directive, DoCheck, Injector, Input, NgMod
* You can control the component creation process by using the following optional attributes:
*
* * `ngComponentOutletInputs`: Optional component inputs object, which will be bind to the
* component.
* component.
*
* * `ngComponentOutletInjector`: Optional custom {@link Injector} that will be used as parent for
* the Component. Defaults to the injector of the current view container.
* the Component. Defaults to the injector of the current view container.
*
* * `ngComponentOutletContent`: Optional list of projectable nodes to insert into the content
* section of the component, if it exists.
* section of the component, if it exists.
*
* * `ngComponentOutletNgModule`: Optional NgModule class reference to allow loading another
* module dynamically, then loading a component from that module.
* module dynamically, then loading a component from that module.
*
* * `ngComponentOutletNgModuleFactory`: Deprecated config option that allows providing optional
* NgModule factory to allow loading another module dynamically, then loading a component from that
* module. Use `ngComponentOutletNgModule` instead.
* NgModule factory to allow loading another module dynamically, then loading a component from that
* module. Use `ngComponentOutletNgModule` instead.
*
* ### Syntax
*
* Simple
*
* ```
* <ng-container *ngComponentOutlet="componentTypeExpression"></ng-container>
* ```
*
* With inputs
*
* ```
* <ng-container *ngComponentOutlet="componentTypeExpression;
* inputs: inputsExpression;">
* </ng-container>
* ```
*
* Customized injector/content
*
* ```
* <ng-container *ngComponentOutlet="componentTypeExpression;
* injector: injectorExpression;
Expand All @@ -60,6 +63,7 @@ import {ComponentRef, createNgModule, Directive, DoCheck, Injector, Input, NgMod
* ```
*
* Customized NgModule reference
*
* ```
* <ng-container *ngComponentOutlet="componentTypeExpression;
* ngModule: ngModuleClass;">
Expand Down
8 changes: 4 additions & 4 deletions packages/common/src/directives/ng_for_of.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,18 +83,18 @@ export class NgForOfContext<T, U extends NgIterable<T> = NgIterable<T>> {
* `NgForOf` provides exported values that can be aliased to local variables.
* For example:
*
* ```
* ```
* <li *ngFor="let user of users; index as i; first as isFirst">
* {{i}}/{{users.length}}. {{user}} <span *ngIf="isFirst">default</span>
* {{i}}/{{users.length}}. {{user}} <span *ngIf="isFirst">default</span>
* </li>
* ```
*
* The following exported values can be aliased to local variables:
*
* - `$implicit: T`: The value of the individual items in the iterable (`ngForOf`).
* - `ngForOf: NgIterable<T>`: The value of the iterable expression. Useful when the expression is
* more complex then a property access, for example when using the async pipe (`userStreams |
* async`).
* more complex then a property access, for example when using the async pipe (`userStreams |
* async`).
* - `index: number`: The index of the current item in the iterable.
* - `count: number`: The length of the iterable.
* - `first: boolean`: True when the item is the first item in the iterable.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,25 +91,30 @@ export const BUILT_IN_LOADERS = [imgixLoaderInfo, imageKitLoaderInfo, cloudinary
*
* `NgOptimizedImage` ensures that the loading of the Largest Contentful Paint (LCP) image is
* prioritized by:
*
* - Automatically setting the `fetchpriority` attribute on the `<img>` tag
* - Lazy loading non-priority images by default
* - Automatically generating a preconnect link tag in the document head
*
* In addition, the directive:
*
* - Generates appropriate asset URLs if a corresponding `ImageLoader` function is provided
* - Automatically generates a srcset
* - Requires that `width` and `height` are set
* - Warns if `width` or `height` have been set incorrectly
* - Warns if the image will be visually distorted when rendered
*
* @usageNotes
*
* The `NgOptimizedImage` directive is marked as [standalone](guide/standalone-components) and can
* be imported directly.
*
* Follow the steps below to enable and use the directive:
*
* 1. Import it into the necessary NgModule or a standalone Component.
* 2. Optionally provide an `ImageLoader` if you use an image hosting service.
* 3. Update the necessary `<img>` tags in templates and replace `src` attributes with `ngSrc`.
*
* Using a `ngSrc` allows the directive to control when the `src` gets set, which triggers an image
* download.
*
Expand Down Expand Up @@ -151,6 +156,7 @@ export const BUILT_IN_LOADERS = [imgixLoaderInfo, imageKitLoaderInfo, cloudinary
* ```
*
* The `NgOptimizedImage` directive provides the following functions:
*
* - `provideCloudflareLoader`
* - `provideCloudinaryLoader`
* - `provideImageKitLoader`
Expand Down Expand Up @@ -227,10 +233,12 @@ export class NgOptimizedImage implements OnInit, OnChanges, OnDestroy {
* descriptors to generate the final `srcset` property of the image.
*
* Example:
*
* ```
* <img ngSrc="hello.jpg" ngSrcset="100w, 200w" /> =>
* <img src="path/hello.jpg" srcset="path/hello.jpg?w=100 100w, path/hello.jpg?w=200 200w" />
* ```
*
*/
@Input() ngSrcset!: string;

Expand All @@ -248,8 +256,9 @@ export class NgOptimizedImage implements OnInit, OnChanges, OnDestroy {

/**
* For responsive images: the intrinsic height of the image in pixels.
* For fixed size images: the desired rendered height of the image in pixels.* The intrinsic
* height of the image in pixels.
* For fixed size images: the desired rendered height of the image in pixels.
* The intrinsic height of the image in pixels.
*
*/
@Input({transform: numberAttribute}) height: number|undefined;

Expand Down Expand Up @@ -536,7 +545,10 @@ export class NgOptimizedImage implements OnInit, OnChanges, OnDestroy {
}
}

/***** Helpers *****/
/**
* \*\* Helpers
*
*/

/**
* Sorts provided config breakpoints and uses defaults.
Expand All @@ -549,7 +561,10 @@ function processConfig(config: ImageConfig): ImageConfig {
return Object.assign({}, IMAGE_CONFIG_DEFAULTS, config, sortedBreakpoints);
}

/***** Assert functions *****/
/**
* \*\* Assert functions
*
*/

/**
* Verifies that there is no `src` set on a host element.
Expand Down Expand Up @@ -741,8 +756,10 @@ function assertGreaterThanZero(dir: NgOptimizedImage, inputValue: unknown, input

/**
* Verifies that the rendered image is not visually distorted. Effectively this is checking:
*
* - Whether the "width" and "height" attributes reflect the actual dimensions of the image.
* - Whether image styling is "correct" (see below for a longer explanation).
*
*/
function assertNoImageDistortion(
dir: NgOptimizedImage, img: HTMLImageElement, renderer: Renderer2) {
Expand Down
Loading

0 comments on commit cb1922f

Please sign in to comment.