diff --git a/packages/common/test/pipes/date_pipe_spec.ts b/packages/common/test/pipes/date_pipe_spec.ts index e9f456c3a2..d45ed67e09 100644 --- a/packages/common/test/pipes/date_pipe_spec.ts +++ b/packages/common/test/pipes/date_pipe_spec.ts @@ -35,7 +35,7 @@ export function main() { }); it('should be marked as pure', - () => { expect(new PipeResolver().resolve(DatePipe).pure).toEqual(true); }); + () => { expect(new PipeResolver().resolve(DatePipe) !.pure).toEqual(true); }); describe('supports', () => { it('should support date', () => { expect(() => pipe.transform(date)).not.toThrow(); }); diff --git a/packages/common/test/pipes/i18n_plural_pipe_spec.ts b/packages/common/test/pipes/i18n_plural_pipe_spec.ts index fa49cdeb01..974d64fe52 100644 --- a/packages/common/test/pipes/i18n_plural_pipe_spec.ts +++ b/packages/common/test/pipes/i18n_plural_pipe_spec.ts @@ -28,7 +28,7 @@ export function main() { }); it('should be marked as pure', - () => { expect(new PipeResolver().resolve(I18nPluralPipe).pure).toEqual(true); }); + () => { expect(new PipeResolver().resolve(I18nPluralPipe) !.pure).toEqual(true); }); describe('transform', () => { it('should return 0 text if value is 0', () => { diff --git a/packages/common/test/pipes/i18n_select_pipe_spec.ts b/packages/common/test/pipes/i18n_select_pipe_spec.ts index 191a607d62..71fede8bac 100644 --- a/packages/common/test/pipes/i18n_select_pipe_spec.ts +++ b/packages/common/test/pipes/i18n_select_pipe_spec.ts @@ -15,7 +15,7 @@ export function main() { const mapping = {'male': 'Invite him.', 'female': 'Invite her.', 'other': 'Invite them.'}; it('should be marked as pure', - () => { expect(new PipeResolver().resolve(I18nSelectPipe).pure).toEqual(true); }); + () => { expect(new PipeResolver().resolve(I18nSelectPipe) !.pure).toEqual(true); }); describe('transform', () => { it('should return the "male" text if value is "male"', () => { diff --git a/packages/compiler-cli/test/mocks.ts b/packages/compiler-cli/test/mocks.ts index da390ce8f9..76cea0cf19 100644 --- a/packages/compiler-cli/test/mocks.ts +++ b/packages/compiler-cli/test/mocks.ts @@ -20,12 +20,12 @@ export class MockAotContext implements CompilerHostContext { directoryExists(path: string): boolean { return typeof this.getEntry(path) === 'object'; } - readFile(fileName: string): string|undefined { + readFile(fileName: string): string { const data = this.getEntry(fileName); if (typeof data === 'string') { return data; } - return undefined; + return undefined !; } readResource(fileName: string): Promise { @@ -38,7 +38,7 @@ export class MockAotContext implements CompilerHostContext { writeFile(fileName: string, data: string): void { const parts = fileName.split('/'); - const name = parts.pop(); + const name = parts.pop() !; const entry = this.getEntry(parts); if (entry && typeof entry !== 'string') { entry[name] = data; @@ -56,7 +56,7 @@ export class MockAotContext implements CompilerHostContext { parts = normalize(parts); let current = this.files; while (parts.length) { - const part = parts.shift(); + const part = parts.shift() !; if (typeof current === 'string') { return undefined; } @@ -82,7 +82,7 @@ export class MockAotContext implements CompilerHostContext { function normalize(parts: string[]): string[] { const result: string[] = []; while (parts.length) { - const part = parts.shift(); + const part = parts.shift() !; switch (part) { case '.': break; @@ -114,7 +114,7 @@ export class MockCompilerHost implements ts.CompilerHost { if (sourceText) { return ts.createSourceFile(fileName, sourceText, languageVersion); } else { - return undefined; + return undefined !; } } diff --git a/packages/compiler/test/aot/static_symbol_resolver_spec.ts b/packages/compiler/test/aot/static_symbol_resolver_spec.ts index 944d6c503c..76a5771bd6 100644 --- a/packages/compiler/test/aot/static_symbol_resolver_spec.ts +++ b/packages/compiler/test/aot/static_symbol_resolver_spec.ts @@ -437,7 +437,7 @@ export class MockStaticSymbolResolverHost implements StaticSymbolResolverHost { return baseName + '.d.ts'; } if (modulePath == 'unresolved') { - return undefined; + return undefined !; } return '/tmp/' + modulePath + '.d.ts'; } diff --git a/packages/compiler/test/aot/test_util.ts b/packages/compiler/test/aot/test_util.ts index 06f7c1dbf7..1b81fb8319 100644 --- a/packages/compiler/test/aot/test_util.ts +++ b/packages/compiler/test/aot/test_util.ts @@ -366,9 +366,9 @@ export class MockAotCompilerHost implements AotCompilerHost { tsFilesOnly() { this.dtsAreSource = false; } // StaticSymbolResolverHost - getMetadataFor(modulePath: string): {[key: string]: any}[]|null { + getMetadataFor(modulePath: string): {[key: string]: any}[]|undefined { if (!this.tsHost.fileExists(modulePath)) { - return null; + return undefined; } if (DTS.test(modulePath)) { if (this.metadataVisible) { @@ -383,7 +383,7 @@ export class MockAotCompilerHost implements AotCompilerHost { const metadata = this.metadataCollector.getMetadata(sf); return metadata ? [metadata] : []; } - return null; + return undefined; } moduleNameToFileName(moduleName: string, containingFile: string): string|null { diff --git a/packages/compiler/test/directive_normalizer_spec.ts b/packages/compiler/test/directive_normalizer_spec.ts index 1ae031b8e5..423b701358 100644 --- a/packages/compiler/test/directive_normalizer_spec.ts +++ b/packages/compiler/test/directive_normalizer_spec.ts @@ -142,7 +142,7 @@ function normalizeLoadedTemplate( styleUrls: o.styleUrls || [], interpolation: o.interpolation || null, encapsulation: o.encapsulation || null, - animations: o.animations || null, + animations: o.animations || [], }, template, templateAbsUrl); } diff --git a/packages/compiler/test/metadata_resolver_spec.ts b/packages/compiler/test/metadata_resolver_spec.ts index 485f082f93..8a540c25fa 100644 --- a/packages/compiler/test/metadata_resolver_spec.ts +++ b/packages/compiler/test/metadata_resolver_spec.ts @@ -55,10 +55,10 @@ export function main() { expect(meta.hostListeners).toEqual({'someHostListener': 'someHostListenerExpr'}); expect(meta.hostProperties).toEqual({'someHostProp': 'someHostPropExpr'}); expect(meta.hostAttributes).toEqual({'someHostAttr': 'someHostAttrValue'}); - expect(meta.template.encapsulation).toBe(ViewEncapsulation.Emulated); - expect(meta.template.styles).toEqual(['someStyle']); - expect(meta.template.template).toEqual('someTemplate'); - expect(meta.template.interpolation).toEqual(['{{', '}}']); + expect(meta.template !.encapsulation).toBe(ViewEncapsulation.Emulated); + expect(meta.template !.styles).toEqual(['someStyle']); + expect(meta.template !.template).toEqual('someTemplate'); + expect(meta.template !.interpolation).toEqual(['{{', '}}']); })); it('should throw when reading metadata for component with external resources when sync=true is passed', @@ -84,9 +84,9 @@ export function main() { resolver.loadNgModuleDirectiveAndPipeMetadata(SomeModule, false).then(() => { const meta = resolver.getDirectiveMetadata(ComponentWithExternalResources); expect(meta.selector).toEqual('someSelector'); - expect(meta.template.styleUrls).toEqual(['someStyleUrl']); - expect(meta.template.templateUrl).toEqual('someTemplateUrl'); - expect(meta.template.template).toEqual('someTemplate'); + expect(meta.template !.styleUrls).toEqual(['someStyleUrl']); + expect(meta.template !.templateUrl).toEqual('someTemplateUrl'); + expect(meta.template !.template).toEqual('someTemplate'); }); resourceLoader.flush(); }))); @@ -104,7 +104,7 @@ export function main() { resolver.loadNgModuleDirectiveAndPipeMetadata(SomeModule, false).then(() => { const value: string = - resolver.getDirectiveMetadata(ComponentWithoutModuleId).template.templateUrl; + resolver.getDirectiveMetadata(ComponentWithoutModuleId).template !.templateUrl !; const expectedEndValue = './someUrl'; expect(value.endsWith(expectedEndValue)).toBe(true); }); diff --git a/packages/core/public_api.ts b/packages/core/public_api.ts index d0b16c5459..ede0762054 100644 --- a/packages/core/public_api.ts +++ b/packages/core/public_api.ts @@ -14,9 +14,3 @@ export * from './src/core'; // This file only reexports content of the `src` folder. Keep it that way. - -// This is a hack to prevent people from turning on strictNullChecks. See #15432 -export declare interface ɵStrictNullChecksNotSupported { - dontUseStrictNullChecksWithAngularYetSeeIssue15432: string|null; - [key: string]: string; -} diff --git a/packages/core/src/application_ref.ts b/packages/core/src/application_ref.ts index d26551582f..5657f358d3 100644 --- a/packages/core/src/application_ref.ts +++ b/packages/core/src/application_ref.ts @@ -89,7 +89,7 @@ export function createPlatform(injector: Injector): PlatformRef { } _platform = injector.get(PlatformRef); const inits = injector.get(PLATFORM_INITIALIZER, null); - if (inits) inits.forEach(init => init()); + if (inits) inits.forEach((init: any) => init()); return _platform; } diff --git a/packages/core/src/change_detection/differs/default_keyvalue_differ.ts b/packages/core/src/change_detection/differs/default_keyvalue_differ.ts index ebff2285d8..588a8371ec 100644 --- a/packages/core/src/change_detection/differs/default_keyvalue_differ.ts +++ b/packages/core/src/change_detection/differs/default_keyvalue_differ.ts @@ -121,7 +121,8 @@ export class DefaultKeyValueDiffer implements KeyValueDiffer, KeyVal this._removalsHead = insertBefore; - for (let record = insertBefore; record !== null; record = record._nextRemoved) { + for (let record: KeyValueChangeRecord_|null = insertBefore; record !== null; + record = record._nextRemoved) { if (record === this._mapHead) { this._mapHead = null; } @@ -150,8 +151,8 @@ export class DefaultKeyValueDiffer implements KeyValueDiffer, KeyVal * - The return value is the new value for the insertion pointer. */ private _insertBeforeOrAppend( - before: KeyValueChangeRecord_, - record: KeyValueChangeRecord_): KeyValueChangeRecord_ { + before: KeyValueChangeRecord_|null, + record: KeyValueChangeRecord_): KeyValueChangeRecord_|null { if (before) { const prev = before._prev; record._next = before; @@ -181,7 +182,7 @@ export class DefaultKeyValueDiffer implements KeyValueDiffer, KeyVal private _getOrCreateRecordForKey(key: K, value: V): KeyValueChangeRecord_ { if (this._records.has(key)) { - const record = this._records.get(key); + const record = this._records.get(key) !; this._maybeAddToChanges(record, value); const prev = record._prev; const next = record._next; diff --git a/packages/core/src/security.ts b/packages/core/src/security.ts index 6d30964044..54f1844780 100644 --- a/packages/core/src/security.ts +++ b/packages/core/src/security.ts @@ -30,7 +30,5 @@ export enum SecurityContext { * @stable */ export abstract class Sanitizer { - abstract sanitize(context: SecurityContext, value: null): null; - abstract sanitize(context: SecurityContext, value: {}|string): string; abstract sanitize(context: SecurityContext, value: {}|string|null): string|null; } diff --git a/packages/core/src/view/element.ts b/packages/core/src/view/element.ts index ca0d585fa4..a3242fea4f 100644 --- a/packages/core/src/view/element.ts +++ b/packages/core/src/view/element.ts @@ -273,7 +273,8 @@ function setElementClass(view: ViewData, renderNode: any, name: string, value: b function setElementStyle( view: ViewData, binding: BindingDef, renderNode: any, name: string, value: any) { - let renderValue: string|null = view.root.sanitizer.sanitize(SecurityContext.STYLE, value); + let renderValue: string|null = + view.root.sanitizer.sanitize(SecurityContext.STYLE, value as{} | string); if (renderValue != null) { renderValue = renderValue.toString(); const unit = binding.suffix; diff --git a/packages/core/test/linker/ng_module_integration_spec.ts b/packages/core/test/linker/ng_module_integration_spec.ts index 3352749e95..cafdf580c2 100644 --- a/packages/core/test/linker/ng_module_integration_spec.ts +++ b/packages/core/test/linker/ng_module_integration_spec.ts @@ -127,7 +127,7 @@ function declareTests({useJit}: {useJit: boolean}) { function createModule( moduleType: Type, parentInjector?: Injector | null): NgModuleRef { - return compiler.compileModuleSync(moduleType).create(parentInjector); + return compiler.compileModuleSync(moduleType).create(parentInjector || null); } function createComp(compType: Type, moduleType: Type): ComponentFixture { diff --git a/packages/core/testing/src/component_fixture.ts b/packages/core/testing/src/component_fixture.ts index cadb2afc7f..23335a71b4 100644 --- a/packages/core/testing/src/component_fixture.ts +++ b/packages/core/testing/src/component_fixture.ts @@ -81,7 +81,7 @@ export class ComponentFixture { // Do this check in the next tick so that ngZone gets a chance to update the state of // pending macrotasks. scheduleMicroTask(() => { - if (!this.ngZone.hasPendingMacrotasks) { + if (!ngZone.hasPendingMacrotasks) { if (this._promise !== null) { this._resolve !(true); this._resolve = null; @@ -141,7 +141,7 @@ export class ComponentFixture { * Return whether the fixture is currently stable or has async tasks that have not been completed * yet. */ - isStable(): boolean { return this._isStable && !this.ngZone.hasPendingMacrotasks; } + isStable(): boolean { return this._isStable && !this.ngZone !.hasPendingMacrotasks; } /** * Get a promise that resolves when the fixture is stable. diff --git a/packages/core/tsconfig-build.json b/packages/core/tsconfig-build.json index b12d701549..4ce7190ba4 100644 --- a/packages/core/tsconfig-build.json +++ b/packages/core/tsconfig-build.json @@ -4,6 +4,7 @@ "declaration": true, "stripInternal": true, "experimentalDecorators": true, + "strictNullChecks": true, "module": "es2015", "moduleResolution": "node", "outDir": "../../dist/packages/core", diff --git a/packages/language-service/test/diagnostics_spec.ts b/packages/language-service/test/diagnostics_spec.ts index 0fc6629a56..86344e8b79 100644 --- a/packages/language-service/test/diagnostics_spec.ts +++ b/packages/language-service/test/diagnostics_spec.ts @@ -211,7 +211,7 @@ describe('diagnostics', () => { export class MyComponent {} `, fileName => { - const diagnostics = ngService.getDiagnostics(fileName); + const diagnostics = ngService.getDiagnostics(fileName) !; const expected = diagnostics.find(d => d.message.startsWith('Invalid providers for')); const notExpected = diagnostics.find(d => d.message.startsWith('Cannot read property')); expect(expected).toBeDefined(); @@ -233,7 +233,7 @@ describe('diagnostics', () => { }) export class MyComponent {} `, - fileName => expectOnlyModuleDiagnostics(ngService.getDiagnostics(fileName))); + fileName => expectOnlyModuleDiagnostics(ngService.getDiagnostics(fileName) !)); }); // Issue #15625 @@ -253,7 +253,7 @@ describe('diagnostics', () => { } `, fileName => { - const diagnostics = ngService.getDiagnostics(fileName); + const diagnostics = ngService.getDiagnostics(fileName) !; expectOnlyModuleDiagnostics(diagnostics); }); }); @@ -323,8 +323,9 @@ describe('diagnostics', () => { } } - function expectOnlyModuleDiagnostics(diagnostics: Diagnostics) { + function expectOnlyModuleDiagnostics(diagnostics: Diagnostics | undefined) { // Expect only the 'MyComponent' diagnostic + if (!diagnostics) throw new Error('Expecting Diagnostics'); expect(diagnostics.length).toBe(1); if (diagnostics.length > 1) { for (const diagnostic of diagnostics) { diff --git a/packages/platform-browser/src/platform-browser.ts b/packages/platform-browser/src/platform-browser.ts index 4018812f9d..deb1df279f 100644 --- a/packages/platform-browser/src/platform-browser.ts +++ b/packages/platform-browser/src/platform-browser.ts @@ -15,6 +15,6 @@ export {NgProbeToken} from './dom/debug/ng_probe'; export {DOCUMENT} from './dom/dom_tokens'; export {EVENT_MANAGER_PLUGINS, EventManager} from './dom/events/event_manager'; export {HAMMER_GESTURE_CONFIG, HammerGestureConfig} from './dom/events/hammer_gestures'; -export {DomSanitizer, SafeHtml, SafeResourceUrl, SafeScript, SafeStyle, SafeUrl} from './security/dom_sanitization_service'; +export {DomSanitizer, SafeHtml, SafeResourceUrl, SafeScript, SafeStyle, SafeUrl, SafeValue} from './security/dom_sanitization_service'; export * from './private_export'; export {VERSION} from './version'; diff --git a/packages/platform-browser/src/security/dom_sanitization_service.ts b/packages/platform-browser/src/security/dom_sanitization_service.ts index 1678786a82..2810968d57 100644 --- a/packages/platform-browser/src/security/dom_sanitization_service.ts +++ b/packages/platform-browser/src/security/dom_sanitization_service.ts @@ -100,8 +100,6 @@ export abstract class DomSanitizer implements Sanitizer { * by replacing URLs that have an unsafe protocol part (such as `javascript:`). The implementation * is responsible to make sure that the value can definitely be safely used in the given context. */ - abstract sanitize(context: SecurityContext, value: null): null; - abstract sanitize(context: SecurityContext, value: SafeValue|string): string; abstract sanitize(context: SecurityContext, value: SafeValue|string|null): string|null; /** @@ -154,14 +152,11 @@ export abstract class DomSanitizer implements Sanitizer { export class DomSanitizerImpl extends DomSanitizer { constructor(@Inject(DOCUMENT) private _doc: any) { super(); } - sanitize(context: SecurityContext, value: null): null; - sanitize(context: SecurityContext, value: SafeValue|string): string; - sanitize(context: SecurityContext, value: SafeValue|string|null): string|null; - sanitize(ctx: SecurityContext, value: any): string|null { + sanitize(ctx: SecurityContext, value: SafeValue|string|null): string|null { if (value == null) return null; switch (ctx) { case SecurityContext.NONE: - return value; + return value as string; case SecurityContext.HTML: if (value instanceof SafeHtmlImpl) return value.changingThisBreaksApplicationSecurity; this.checkNotSafeValue(value, 'HTML'); @@ -169,7 +164,7 @@ export class DomSanitizerImpl extends DomSanitizer { case SecurityContext.STYLE: if (value instanceof SafeStyleImpl) return value.changingThisBreaksApplicationSecurity; this.checkNotSafeValue(value, 'Style'); - return sanitizeStyle(value); + return sanitizeStyle(value as string); case SecurityContext.SCRIPT: if (value instanceof SafeScriptImpl) return value.changingThisBreaksApplicationSecurity; this.checkNotSafeValue(value, 'Script'); diff --git a/packages/platform-browser/testing/src/matchers.ts b/packages/platform-browser/testing/src/matchers.ts index ea38f2a9f1..f43fe4e051 100644 --- a/packages/platform-browser/testing/src/matchers.ts +++ b/packages/platform-browser/testing/src/matchers.ts @@ -121,7 +121,7 @@ _global.beforeEach(function() { } }; - function compareMap(actual: any, expected: any): boolean|undefined { + function compareMap(actual: any, expected: any): boolean { if (actual instanceof Map) { let pass = actual.size === expected.size; if (pass) { @@ -129,7 +129,8 @@ _global.beforeEach(function() { } return pass; } else { - return undefined; + // TODO(misko): we should change the return, but jasmine.d.ts is not null safe + return undefined !; } } }, diff --git a/packages/router/test/integration.spec.ts b/packages/router/test/integration.spec.ts index 940c1f856c..f130aefc5c 100644 --- a/packages/router/test/integration.spec.ts +++ b/packages/router/test/integration.spec.ts @@ -3050,12 +3050,12 @@ describe('Integration', () => { advance(fixture); const config = router.config; - const firstConfig = config[1]._loadedConfig; + const firstConfig = config[1]._loadedConfig !; expect(firstConfig).toBeDefined(); expect(firstConfig.routes[0].path).toEqual('LoadedModule1'); - const secondConfig = firstConfig.routes[0]._loadedConfig; + const secondConfig = firstConfig.routes[0]._loadedConfig !; expect(secondConfig).toBeDefined(); expect(secondConfig.routes[0].path).toEqual('LoadedModule2'); }))); diff --git a/packages/router/test/router_preloader.spec.ts b/packages/router/test/router_preloader.spec.ts index c1b8d2afd4..5807522d7b 100644 --- a/packages/router/test/router_preloader.spec.ts +++ b/packages/router/test/router_preloader.spec.ts @@ -97,12 +97,12 @@ describe('RouterPreloader', () => { const c = router.config; expect(c[0].loadChildren).toEqual('expected'); - const loadedConfig: LoadedRouterConfig = c[0]._loadedConfig; + const loadedConfig: LoadedRouterConfig = c[0]._loadedConfig !; const module: any = loadedConfig.module; expect(loadedConfig.routes[0].path).toEqual('LoadedModule1'); expect(module.parent).toBe(testModule); - const loadedConfig2: LoadedRouterConfig = loadedConfig.routes[0]._loadedConfig; + const loadedConfig2: LoadedRouterConfig = loadedConfig.routes[0]._loadedConfig !; const module2: any = loadedConfig2.module; expect(loadedConfig2.routes[0].path).toEqual('LoadedModule2'); expect(module2.parent).toBe(module); @@ -165,12 +165,12 @@ describe('RouterPreloader', () => { const c = router.config; - const loadedConfig: LoadedRouterConfig = c[0]._loadedConfig; + const loadedConfig: LoadedRouterConfig = c[0]._loadedConfig !; const module: any = loadedConfig.module; expect(module.parent).toBe(testModule); - const loadedConfig2: LoadedRouterConfig = loadedConfig.routes[0]._loadedConfig; - const loadedConfig3: LoadedRouterConfig = loadedConfig2.routes[0]._loadedConfig; + const loadedConfig2: LoadedRouterConfig = loadedConfig.routes[0]._loadedConfig !; + const loadedConfig3: LoadedRouterConfig = loadedConfig2.routes[0]._loadedConfig !; const module3: any = loadedConfig3.module; expect(module3.parent).toBe(module2); }))); diff --git a/packages/tsconfig.json b/packages/tsconfig.json index 6020735526..2af993963d 100644 --- a/packages/tsconfig.json +++ b/packages/tsconfig.json @@ -6,7 +6,7 @@ "emitDecoratorMetadata": true, "module": "commonjs", "moduleResolution": "node", - "strictNullChecks": false, + "strictNullChecks": true, "outDir": "../dist/all/@angular", "noImplicitAny": true, "noFallthroughCasesInSwitch": true, diff --git a/packages/upgrade/src/common/angular1.ts b/packages/upgrade/src/common/angular1.ts index 921bbb4e1c..3e45a23caf 100644 --- a/packages/upgrade/src/common/angular1.ts +++ b/packages/upgrade/src/common/angular1.ts @@ -207,7 +207,8 @@ let angular: { void, module: (prefix: string, dependencies?: string[]) => IModule, element: (e: Element | string) => IAugmentedJQuery, - version: {major: number}, resumeBootstrap?: () => void, + version: {major: number}, + resumeBootstrap: () => void, getTestability: (e: Element) => ITestabilityService } = { bootstrap: noNg, diff --git a/tools/public_api_guard/core/core.d.ts b/tools/public_api_guard/core/core.d.ts index 3ebced5516..84d2401ef9 100644 --- a/tools/public_api_guard/core/core.d.ts +++ b/tools/public_api_guard/core/core.d.ts @@ -341,7 +341,7 @@ export declare class DebugNode { /** @deprecated */ export declare class DefaultIterableDiffer implements IterableDiffer, IterableChanges { - readonly collection: NgIterable; + readonly collection: V[] | Iterable | null; readonly isDirty: boolean; readonly length: number; constructor(trackByFn?: TrackByFunction); @@ -716,7 +716,7 @@ export declare const PLATFORM_ID: InjectionToken; export declare const PLATFORM_INITIALIZER: InjectionToken<(() => void)[]>; /** @experimental */ -export declare const platformCore: (extraProviders?: Provider[]) => PlatformRef; +export declare const platformCore: (extraProviders?: Provider[] | undefined) => PlatformRef; /** @stable */ export declare abstract class PlatformRef { @@ -891,7 +891,7 @@ export declare abstract class RootRenderer { /** @stable */ export declare abstract class Sanitizer { - abstract sanitize(context: SecurityContext, value: string): string | null; + abstract sanitize(context: SecurityContext, value: {} | string | null): string | null; } /** @experimental */ diff --git a/tools/public_api_guard/platform-browser/platform-browser.d.ts b/tools/public_api_guard/platform-browser/platform-browser.d.ts index 720cc711c7..6632398d48 100644 --- a/tools/public_api_guard/platform-browser/platform-browser.d.ts +++ b/tools/public_api_guard/platform-browser/platform-browser.d.ts @@ -26,7 +26,7 @@ export declare abstract class DomSanitizer implements Sanitizer { abstract bypassSecurityTrustScript(value: string): SafeScript; abstract bypassSecurityTrustStyle(value: string): SafeStyle; abstract bypassSecurityTrustUrl(value: string): SafeUrl; - abstract sanitize(context: SecurityContext, value: any): string | null; + abstract sanitize(context: SecurityContext, value: SafeValue | string | null): string | null; } /** @experimental */ @@ -112,6 +112,10 @@ export interface SafeStyle extends SafeValue { export interface SafeUrl extends SafeValue { } +/** @stable */ +export interface SafeValue { +} + /** @experimental */ export declare class Title { constructor(_doc: any); diff --git a/tools/public_api_guard/router/router.d.ts b/tools/public_api_guard/router/router.d.ts index 6dc3d5d2fa..27008b53d3 100644 --- a/tools/public_api_guard/router/router.d.ts +++ b/tools/public_api_guard/router/router.d.ts @@ -135,9 +135,9 @@ export interface NavigationExtras { fragment?: string; preserveFragment?: boolean; /** @deprecated */ preserveQueryParams?: boolean; - queryParams?: Params; - queryParamsHandling?: QueryParamsHandling; - relativeTo?: ActivatedRoute; + queryParams?: Params | null; + queryParamsHandling?: QueryParamsHandling | null; + relativeTo?: ActivatedRoute | null; replaceUrl?: boolean; skipLocationChange?: boolean; }