Skip to content

Commit

Permalink
fix: fixing doc urls
Browse files Browse the repository at this point in the history
  • Loading branch information
satanTime committed Jan 20, 2021
1 parent 0306643 commit 5fc0ae3
Show file tree
Hide file tree
Showing 20 changed files with 133 additions and 133 deletions.
10 changes: 5 additions & 5 deletions lib/common/func.get-mocked-ng-def-of.ts
Expand Up @@ -28,35 +28,35 @@ const getMock = (declaration: any, source: any, mocks?: Map<any, any>) => {
/**
* Returns a def of a mock module based on a mock module or a source module.
*
* @see https://github.com/ike18t/ng-mocks#getmockedngdefof
* @see https://ng-mocks.sudo.eu/api/helpers/getMockedNgDefOf
*/
export function getMockedNgDefOf<T>(declaration: AnyType<T>, type: 'm'): Type<MockedModule<T>>;

/**
* Returns a def of a mock component based on a mock component or a source component.
*
* @see https://github.com/ike18t/ng-mocks#getmockedngdefof
* @see https://ng-mocks.sudo.eu/api/helpers/getMockedNgDefOf
*/
export function getMockedNgDefOf<T>(declaration: AnyType<T>, type: 'c'): Type<MockedComponent<T>>;

/**
* Returns a def of a mock directive based on a mock directive or a source directive.
*
* @see https://github.com/ike18t/ng-mocks#getmockedngdefof
* @see https://ng-mocks.sudo.eu/api/helpers/getMockedNgDefOf
*/
export function getMockedNgDefOf<T>(declaration: AnyType<T>, type: 'd'): Type<MockedDirective<T>>;

/**
* Returns a def of a mock pipe based on a mock pipe or a source pipe.
*
* @see https://github.com/ike18t/ng-mocks#getmockedngdefof
* @see https://ng-mocks.sudo.eu/api/helpers/getMockedNgDefOf
*/
export function getMockedNgDefOf<T>(declaration: AnyType<T>, type: 'p'): Type<MockedPipe<T>>;

/**
* Returns a def of a mock class based on a mock class or a source class decorated by a ng type.
*
* @see https://github.com/ike18t/ng-mocks#getmockedngdefof
* @see https://ng-mocks.sudo.eu/api/helpers/getMockedNgDefOf
*/
export function getMockedNgDefOf(declaration: AnyType<any>): Type<any>;

Expand Down
12 changes: 6 additions & 6 deletions lib/common/func.get-source-of-mock.ts
Expand Up @@ -8,42 +8,42 @@ import { Type } from './core.types';
/**
* Returns an original type.
*
* @see https://github.com/ike18t/ng-mocks#getsourceofmock
* @see https://ng-mocks.sudo.eu/api/helpers/getSourceOfMock
*/
export function getSourceOfMock<T>(declaration: Type<MockedModule<T>>): Type<T>;

/**
* Returns an original type.
*
* @see https://github.com/ike18t/ng-mocks#getsourceofmock
* @see https://ng-mocks.sudo.eu/api/helpers/getSourceOfMock
*/
export function getSourceOfMock<T>(declaration: Type<MockedComponent<T>>): Type<T>;

/**
* Returns an original type.
*
* @see https://github.com/ike18t/ng-mocks#getsourceofmock
* @see https://ng-mocks.sudo.eu/api/helpers/getSourceOfMock
*/
export function getSourceOfMock<T>(declaration: Type<MockedDirective<T>>): Type<T>;

/**
* Returns an original type.
*
* @see https://github.com/ike18t/ng-mocks#getsourceofmock
* @see https://ng-mocks.sudo.eu/api/helpers/getSourceOfMock
*/
export function getSourceOfMock<T>(declaration: Type<MockedPipe<T>>): Type<T>;

/**
* Returns an original type.
*
* @see https://github.com/ike18t/ng-mocks#getsourceofmock
* @see https://ng-mocks.sudo.eu/api/helpers/getSourceOfMock
*/
export function getSourceOfMock<T>(declaration: Type<T>): Type<T>;

/**
* Returns an original type.
*
* @see https://github.com/ike18t/ng-mocks#getsourceofmock
* @see https://ng-mocks.sudo.eu/api/helpers/getSourceOfMock
*/
export function getSourceOfMock<T>(declaration: any): Type<T> {
return typeof declaration === 'function' && declaration.mockOf ? declaration.mockOf : declaration;
Expand Down
2 changes: 1 addition & 1 deletion lib/common/func.is-mock-control-value-accessor.ts
Expand Up @@ -2,7 +2,7 @@ import funcIsMock from './func.is-mock';
import { MockControlValueAccessor } from './mock-control-value-accessor';

/**
* @see https://github.com/ike18t/ng-mocks#ismockcontrolvalueaccessor
* @see https://ng-mocks.sudo.eu/api/helpers/isMockControlValueAccessor
*/
export const isMockControlValueAccessor = <T>(value: T): value is T & MockControlValueAccessor => {
if (!funcIsMock(value)) {
Expand Down
10 changes: 5 additions & 5 deletions lib/common/func.is-mock-of.ts
Expand Up @@ -12,28 +12,28 @@ import { isNgDef } from './func.is-ng-def';
/**
* Checks whether the instance derives from a mock module.
*
* @see https://github.com/ike18t/ng-mocks#ismockof
* @see https://ng-mocks.sudo.eu/api/helpers/isMockOf
*/
export function isMockOf<T>(instance: any, declaration: Type<T>, ngType: 'm'): instance is MockedModule<T>;

/**
* Checks whether the instance derives from a mock component.
*
* @see https://github.com/ike18t/ng-mocks#ismockof
* @see https://ng-mocks.sudo.eu/api/helpers/isMockOf
*/
export function isMockOf<T>(instance: any, declaration: Type<T>, ngType: 'c'): instance is MockedComponent<T>;

/**
* Checks whether the instance derives from a mock directive.
*
* @see https://github.com/ike18t/ng-mocks#ismockof
* @see https://ng-mocks.sudo.eu/api/helpers/isMockOf
*/
export function isMockOf<T>(instance: any, declaration: Type<T>, ngType: 'd'): instance is MockedDirective<T>;

/**
* Checks whether the instance derives from a mock pipe.
*
* @see https://github.com/ike18t/ng-mocks#ismockof
* @see https://ng-mocks.sudo.eu/api/helpers/isMockOf
*/
export function isMockOf<T extends PipeTransform>(
instance: any,
Expand All @@ -44,7 +44,7 @@ export function isMockOf<T extends PipeTransform>(
/**
* Checks whether the instance derives from a mock type.
*
* @see https://github.com/ike18t/ng-mocks#ismockof
* @see https://ng-mocks.sudo.eu/api/helpers/isMockOf
*/
export function isMockOf<T>(instance: any, declaration: Type<T>): instance is T;

Expand Down
2 changes: 1 addition & 1 deletion lib/common/func.is-mock-validator.ts
Expand Up @@ -2,7 +2,7 @@ import funcIsMock from './func.is-mock';
import { MockValidator } from './mock-control-value-accessor';

/**
* @see https://github.com/ike18t/ng-mocks#ismockvalidator
* @see https://ng-mocks.sudo.eu/api/helpers/isMockValidator
*/
export const isMockValidator = <T>(value: T): value is T & MockValidator => {
if (!funcIsMock(value)) {
Expand Down
10 changes: 5 additions & 5 deletions lib/common/func.is-mocked-ng-def-of.ts
Expand Up @@ -11,14 +11,14 @@ import { isNgDef } from './func.is-ng-def';
/**
* Checks whether the declaration is a mock one and derives from the specified module.
*
* @see https://github.com/ike18t/ng-mocks#ismockedngdefof
* @see https://ng-mocks.sudo.eu/api/helpers/isMockedNgDefOf
*/
export function isMockedNgDefOf<T>(declaration: any, type: Type<T>, ngType: 'm'): declaration is Type<MockedModule<T>>;

/**
* Checks whether the declaration is a mock one and derives from the specified component.
*
* @see https://github.com/ike18t/ng-mocks#ismockedngdefof
* @see https://ng-mocks.sudo.eu/api/helpers/isMockedNgDefOf
*/
export function isMockedNgDefOf<T>(
declaration: any,
Expand All @@ -29,7 +29,7 @@ export function isMockedNgDefOf<T>(
/**
* Checks whether the declaration is a mock one and derives from the specified directive.
*
* @see https://github.com/ike18t/ng-mocks#ismockedngdefof
* @see https://ng-mocks.sudo.eu/api/helpers/isMockedNgDefOf
*/
export function isMockedNgDefOf<T>(
declaration: any,
Expand All @@ -40,7 +40,7 @@ export function isMockedNgDefOf<T>(
/**
* Checks whether the declaration is a mock one and derives from the specified pipe.
*
* @see https://github.com/ike18t/ng-mocks#ismockedngdefof
* @see https://ng-mocks.sudo.eu/api/helpers/isMockedNgDefOf
*/
export function isMockedNgDefOf<T extends PipeTransform>(
declaration: any,
Expand All @@ -51,7 +51,7 @@ export function isMockedNgDefOf<T extends PipeTransform>(
/**
* Checks whether the declaration is a mock one and derives from the specified type.
*
* @see https://github.com/ike18t/ng-mocks#ismockedngdefof
* @see https://ng-mocks.sudo.eu/api/helpers/isMockedNgDefOf
*/
export function isMockedNgDefOf<T>(declaration: any, type: Type<T>): declaration is Type<T>;

Expand Down
14 changes: 7 additions & 7 deletions lib/common/func.is-ng-def.ts
Expand Up @@ -16,49 +16,49 @@ const isInjectableCheck = (def: any, ngType?: string): boolean =>
/**
* Checks whether a class was decorated by @NgModule.
*
* @see https://github.com/ike18t/ng-mocks#isngdef
* @see https://ng-mocks.sudo.eu/api/helpers/isNgDef
*/
export function isNgDef(declaration: any, ngType: 'm'): declaration is Type<any>;

/**
* Checks whether a class was decorated by @Component.
*
* @see https://github.com/ike18t/ng-mocks#isngdef
* @see https://ng-mocks.sudo.eu/api/helpers/isNgDef
*/
export function isNgDef(declaration: any, ngType: 'c'): declaration is Type<any>;

/**
* Checks whether a class was decorated by @Directive.
*
* @see https://github.com/ike18t/ng-mocks#isngdef
* @see https://ng-mocks.sudo.eu/api/helpers/isNgDef
*/
export function isNgDef(declaration: any, ngType: 'd'): declaration is Type<any>;

/**
* Checks whether a class was decorated by @Pipe.
*
* @see https://github.com/ike18t/ng-mocks#isngdef
* @see https://ng-mocks.sudo.eu/api/helpers/isNgDef
*/
export function isNgDef(declaration: any, ngType: 'p'): declaration is Type<PipeTransform>;

/**
* Checks whether a class was decorated by @Injectable.
*
* @see https://github.com/ike18t/ng-mocks#isngdef
* @see https://ng-mocks.sudo.eu/api/helpers/isNgDef
*/
export function isNgDef(declaration: any, ngType: 'i'): declaration is Type<any>;

/**
* Checks whether a class was decorated by @Injectable.
*
* @see https://github.com/ike18t/ng-mocks#isngdef
* @see https://ng-mocks.sudo.eu/api/helpers/isNgDef
*/
export function isNgDef(declaration: any, ngType: 't'): declaration is InjectionToken<any>;

/**
* Checks whether a class was decorated by a ng type.
*
* @see https://github.com/ike18t/ng-mocks#isngdef
* @see https://ng-mocks.sudo.eu/api/helpers/isNgDef
*/
export function isNgDef(declaration: any): declaration is Type<any>;

Expand Down
2 changes: 1 addition & 1 deletion lib/common/func.is-ng-injection-token.ts
Expand Up @@ -3,7 +3,7 @@ import { InjectionToken } from '@angular/core';
/**
* Checks whether a variable is a real token.
*
* @see https://github.com/ike18t/ng-mocks#isnginjectiontoken
* @see https://ng-mocks.sudo.eu/api/helpers/isNgInjectionToken
*/
export const isNgInjectionToken = (token: any): token is InjectionToken<any> =>
token && typeof token === 'object' && token.ngMetadataName === 'InjectionToken';
20 changes: 10 additions & 10 deletions lib/common/mock-control-value-accessor.ts
Expand Up @@ -4,13 +4,13 @@ import { Mock } from './mock';

/**
* @deprecated use isMockControlValueAccessor or isMockValidator instead
* @see https://github.com/ike18t/ng-mocks#ismockcontrolvalueaccessor
* @see https://github.com/ike18t/ng-mocks#ismockvalidator
* @see https://ng-mocks.sudo.eu/api/helpers/isMockControlValueAccessor
* @see https://ng-mocks.sudo.eu/api/helpers/isMockValidator
*/
export class LegacyControlValueAccessor extends Mock {
/**
* @deprecated use isMockControlValueAccessor instead
* @see https://github.com/ike18t/ng-mocks#ismockcontrolvalueaccessor
* @see https://ng-mocks.sudo.eu/api/helpers/isMockControlValueAccessor
*/
public __simulateChange(value: any): void;
// istanbul ignore next
Expand All @@ -21,7 +21,7 @@ export class LegacyControlValueAccessor extends Mock {
// istanbul ignore next
/**
* @deprecated use isMockControlValueAccessor instead
* @see https://github.com/ike18t/ng-mocks#ismockcontrolvalueaccessor
* @see https://ng-mocks.sudo.eu/api/helpers/isMockControlValueAccessor
*/
public __simulateTouch() {
// nothing to do.
Expand All @@ -30,34 +30,34 @@ export class LegacyControlValueAccessor extends Mock {
// istanbul ignore next
/**
* @deprecated use isMockValidator instead
* @see https://github.com/ike18t/ng-mocks#ismockvalidator
* @see https://ng-mocks.sudo.eu/api/helpers/isMockValidator
*/
public __simulateValidatorChange() {
// nothing to do.
}
}

/**
* @see https://github.com/ike18t/ng-mocks#ismockcontrolvalueaccessor
* @see https://ng-mocks.sudo.eu/api/helpers/isMockControlValueAccessor
*/
export interface MockControlValueAccessor {
/**
* @see https://github.com/ike18t/ng-mocks#how-to-mock-form-controls
* @see https://ng-mocks.sudo.eu/extra/mock-form-controls
*/
__simulateChange(value: any): void;

/**
* @see https://github.com/ike18t/ng-mocks#how-to-mock-form-controls
* @see https://ng-mocks.sudo.eu/extra/mock-form-controls
*/
__simulateTouch(): void;
}

/**
* @see https://github.com/ike18t/ng-mocks#ismockvalidator
* @see https://ng-mocks.sudo.eu/api/helpers/isMockValidator
*/
export interface MockValidator {
/**
* @see https://github.com/ike18t/ng-mocks#how-to-mock-form-controls
* @see https://ng-mocks.sudo.eu/extra/mock-form-controls
*/
__simulateValidatorChange(): void;
}
2 changes: 1 addition & 1 deletion lib/mock-builder/mock-builder.ts
Expand Up @@ -113,7 +113,7 @@ const resetTestingModule = (
};

/**
* @see https://github.com/ike18t/ng-mocks#mockbuilder
* @see https://ng-mocks.sudo.eu/api/MockBuilder
*/
export function MockBuilder(
keepDeclaration?: string | AnyType<any> | InjectionToken<any> | null | undefined,
Expand Down

0 comments on commit 5fc0ae3

Please sign in to comment.