X Tutup
Skip to content

fix(typings): include static members#3780

Closed
alexeagle wants to merge 1 commit intoangular:masterfrom
alexeagle:fix3175
Closed

fix(typings): include static members#3780
alexeagle wants to merge 1 commit intoangular:masterfrom
alexeagle:fix3175

Conversation

@alexeagle
Copy link
Copy Markdown
Contributor

Fixes #3175

diff:

$ diff before.d.ts dist/docs/typings/angular2/angular2.d.ts
1c1
< // Type definitions for Angular v2.0.0-local_sha.65344fc

---
> // Type definitions for Angular v2.0.0-local_sha.bc2a5ee
2022a2023,2024
>      static wrap(value: any): WrappedValue;
>
2077a2080,2103
>      static create(factories: IterableDifferFactory[], parent?: IterableDiffers): IterableDiffers;
>
>
>     /**
>      * Takes an array of {@link IterableDifferFactory} and returns a binding used to extend the
>      * inherited {@link IterableDiffers} instance with the provided factories and return a new
>      * {@link IterableDiffers} instance.
>      *
>      * The following example shows how to extend an existing list of factories,
>      * which will only be applied to the injector for this component and its children.
>      * This step is all that's required to make a new {@link IterableDiffer} available.
>      *
>      * # Example
>      *
>      * ```
>      * @Component({
>      *   viewBindings: [
>      *     IterableDiffers.extend([new ImmutableListDiffer()])
>      *   ]
>      * })
>      * ```
>      */
>      static extend(factories: IterableDifferFactory[]): Binding;
>
2106a2133,2156
>      static create(factories: KeyValueDifferFactory[], parent?: KeyValueDiffers): KeyValueDiffers;
>
>
>     /**
>      * Takes an array of {@link KeyValueDifferFactory} and returns a binding used to extend the
>      * inherited {@link KeyValueDiffers} instance with the provided factories and return a new
>      * {@link KeyValueDiffers} instance.
>      *
>      * The following example shows how to extend an existing list of factories,
>      * which will only be applied to the injector for this component and its children.
>      * This step is all that's required to make a new {@link KeyValueDiffer} available.
>      *
>      * # Example
>      *
>      * ```
>      * @Component({
>      *   viewBindings: [
>      *     KeyValueDiffers.extend([new ImmutableMapDiffer()])
>      *   ]
>      * })
>      * ```
>      */
>      static extend(factories: KeyValueDifferFactory[]): Binding;
>
3548a3599,3644
>      * Turns a list of binding definitions into an internal resolved list of resolved bindings.
>      *
>      * A resolution is a process of flattening multiple nested lists and converting individual
>      * bindings into a list of {@link ResolvedBinding}s. The resolution can be cached by `resolve`
>      * for the {@link Injector} for performance-sensitive code.
>      *
>      * @param `bindings` can be a list of `Type`, {@link Binding}, {@link ResolvedBinding}, or a
>      * recursive list of more bindings.
>      *
>      * The returned list is sparse, indexed by `id` for the {@link Key}. It is generally not useful to
>      * application code
>      * other than for passing it to {@link Injector} functions that require resolved binding lists,
>      * such as
>      * `fromResolvedBindings` and `createChildFromResolved`.
>      */
>      static resolve(bindings: List<Type | Binding | List<any>>): List<ResolvedBinding>;
>
>
>     /**
>      * Resolves bindings and creates an injector based on those bindings. This function is slower than
>      * the corresponding `fromResolvedBindings` because it needs to resolve bindings first. See
>      * `resolve`
>      * for the {@link Injector}.
>      *
>      * Prefer `fromResolvedBindings` in performance-critical code that creates lots of injectors.
>      *
>      * @param `bindings` can be a list of `Type`, {@link Binding}, {@link ResolvedBinding}, or a
>      * recursive list of more
>      * bindings.
>      * @param `depProvider`
>      */
>      static resolveAndCreate(bindings: List<Type | Binding | List<any>>, depProvider?: DependencyProvider): Injector;
>
>
>     /**
>      * Creates an injector from previously resolved bindings. This bypasses resolution and flattening.
>      * This API is the recommended way to construct injectors in performance-sensitive parts.
>      *
>      * @param `bindings` A sparse list of {@link ResolvedBinding}s. See `resolve` for the
>      * {@link Injector}.
>      * @param `depProvider`
>      */
>      static fromResolvedBindings(bindings: List<ResolvedBinding>, depProvider?: DependencyProvider): Injector;
>
>
>     /**
3985a4082,4083
>      static fromKey(key: Key): Dependency;
>
4024a4123,4134
>
>     /**
>      * Retrieves a `Key` for a token.
>      */
>      static get(token: Object): Key;
>
>
>     /**
>      * @returns the number of keys registered in the system.
>      */
>      static numberOfKeys: number;
>
4382a4493,4496
>      static bulkRemove(tuples: List<RecordViewTuple>, viewContainer: ViewContainerRef): List<RecordViewTuple>;
>
>      static bulkInsert(tuples: List<RecordViewTuple>, viewContainer: ViewContainerRef, templateRef: TemplateRef): List<RecordViewTuple>;
>
5316a5431,5440
>
>      static required(c:Control): StringMap<string, boolean>;
>
>      static nullValidator(c: any): StringMap<string, boolean>;
>
>      static compose(validators: List<Function>): Function;
>
>      static group(c:ControlGroup): StringMap<string, boolean>;
>
>      static array(c:ControlArray): StringMap<string, boolean>;
5406a5531,5554
>      static DIRECTIVE_TYPE: any;
>
>      static COMPONENT_TYPE: any;
>
>      static create({id, selector, compileChildren, events, host, properties, readAttributes, type,
>                  callOnDestroy, callOnChange, callOnCheck, callOnInit, callOnAllChangesDone,
>                  changeDetection, exportAs}: {
>     id?: string,
>     selector?: string,
>     compileChildren?: boolean,
>     events?: List<string>,
>     host?: Map<string, string>,
>     properties?: List<string>,
>     readAttributes?: List<string>,
>     type?: number,
>     callOnDestroy?: boolean,
>     callOnChange?: boolean,
>     callOnCheck?: boolean,
>     callOnInit?: boolean,
>     callOnAllChangesDone?: boolean,
>     changeDetection?: string,
>     exportAs?: string
>   }): RenderDirectiveMetadata;
>

@alexeagle
Copy link
Copy Markdown
Contributor Author

I looked at dist/docs/partials/modules/angular2/forms/Validators/index.html and I don't see these static members there. They should be documented on angular.io as well, right?

@alexeagle alexeagle assigned mhevery and unassigned petebacondarwin Aug 24, 2015
@alexeagle
Copy link
Copy Markdown
Contributor Author

Note, I've made statics a separate array from exports, so they can be listed first in the type definitions.
We could instead expose only a single list and let the static members be sorted alpha with the non-static members.

@mhevery mhevery assigned alexeagle and unassigned mhevery Aug 25, 2015
@mhevery mhevery added the action: merge The PR is ready for merge by the caretaker label Aug 25, 2015
@mary-poppins mary-poppins removed the action: merge The PR is ready for merge by the caretaker label Aug 25, 2015
@mary-poppins
Copy link
Copy Markdown

Merging PR #3780 on behalf of @mhevery to branch presubmit-mhevery-pr-3780.

@alexeagle alexeagle closed this in 894af28 Aug 25, 2015
@angular-automatic-lock-bot
Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

static methods are missing from angular2.d.ts

5 participants

X Tutup