@opra/angular 1.19.5 → 1.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,76 @@
1
+ import * as Angular from '@angular/common/http';
2
+ import { HttpContext, HttpParams } from '@angular/common/http';
3
+ import { HttpBackend, HttpEvent, HttpResponse } from '@opra/client';
4
+ import { Observable } from 'rxjs';
5
+ import { StrictOmit } from 'ts-gems';
6
+ import * as i0 from '@angular/core';
7
+ import { InjectionToken, NgModule, Type, ModuleWithProviders } from '@angular/core';
8
+
9
+ /**
10
+ *
11
+ * @class AngularBackend
12
+ */
13
+ declare class AngularBackend extends HttpBackend {
14
+ readonly httpClient: Angular.HttpClient;
15
+ defaults: AngularBackend.RequestDefaults;
16
+ constructor(httpClient: Angular.HttpClient, serviceUrl: string, options?: AngularBackend.Options);
17
+ handle(init: AngularBackend.RequestInit): Observable<HttpEvent>;
18
+ protected send(request: Angular.HttpRequest<any>): any;
19
+ protected prepareRequest(init: AngularBackend.RequestInit): AngularBackend.RequestInit;
20
+ protected createResponse(init: HttpResponse.Initiator): HttpResponse;
21
+ protected parseBody(fetchResponse: Response): Promise<any>;
22
+ }
23
+ /**
24
+ * @namespace AngularBackend
25
+ */
26
+ declare namespace AngularBackend {
27
+ interface Options extends HttpBackend.Options {
28
+ defaults?: RequestDefaults;
29
+ }
30
+ interface RequestInit extends HttpBackend.RequestInit {
31
+ context?: HttpContext;
32
+ reportProgress?: boolean;
33
+ params?: HttpParams;
34
+ responseType?: 'arraybuffer' | 'blob' | 'json' | 'text';
35
+ withCredentials?: boolean;
36
+ }
37
+ interface RequestOptions extends Pick<RequestInit, 'context' | 'reportProgress' | 'withCredentials'> {
38
+ }
39
+ type RequestDefaults = StrictOmit<RequestOptions, 'context'> & {
40
+ headers: Headers;
41
+ params: URLSearchParams;
42
+ };
43
+ }
44
+
45
+ type OpraClientModuleOptions = AngularBackend.Options & {
46
+ serviceUrl: string;
47
+ token?: string | InjectionToken<any>;
48
+ };
49
+ type _OpraClientModuleOptions = StrictOmit<OpraClientModuleOptions, 'token'>;
50
+ interface OpraModuleOptionsFactory {
51
+ createOptions(): Promise<_OpraClientModuleOptions> | _OpraClientModuleOptions;
52
+ }
53
+ interface OpraClientModuleAsyncOptions extends Pick<NgModule, 'imports' | 'providers'> {
54
+ token?: string | InjectionToken<any>;
55
+ useExisting?: Type<OpraModuleOptionsFactory>;
56
+ useClass?: Type<any>;
57
+ useFactory?: (...args: any[]) => Promise<_OpraClientModuleOptions> | _OpraClientModuleOptions;
58
+ deps?: any[];
59
+ }
60
+
61
+ declare class OpraClientModule {
62
+ static registerClient(options: OpraClientModuleOptions): ModuleWithProviders<OpraClientModule>;
63
+ static registerService<T>(serviceClass: Type<T>, options: OpraClientModuleOptions): ModuleWithProviders<OpraClientModule>;
64
+ static registerClientAsync(options: OpraClientModuleAsyncOptions): ModuleWithProviders<OpraClientModule>;
65
+ static registerServiceAsync<T>(serviceClass: Type<T>, options: OpraClientModuleAsyncOptions): ModuleWithProviders<OpraClientModule>;
66
+ private static _createAsyncProviders;
67
+ private static _createAsyncOptionsProvider;
68
+ static ɵfac: i0.ɵɵFactoryDeclaration<OpraClientModule, never>;
69
+ static ɵmod: i0.ɵɵNgModuleDeclaration<OpraClientModule, never, never, never>;
70
+ static ɵinj: i0.ɵɵInjectorDeclaration<OpraClientModule>;
71
+ }
72
+
73
+ declare const OPRA_CLIENT_MODULE_OPTIONS = "OPRA_CLIENT_MODULE_OPTIONS";
74
+
75
+ export { AngularBackend, OPRA_CLIENT_MODULE_OPTIONS, OpraClientModule };
76
+ export type { OpraClientModuleAsyncOptions, OpraClientModuleOptions, OpraModuleOptionsFactory };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opra/angular",
3
- "version": "1.19.5",
3
+ "version": "1.20.0",
4
4
  "description": "Opra internationalization package",
5
5
  "author": "Panates",
6
6
  "license": "MIT",
@@ -27,27 +27,27 @@
27
27
  "@angular/common": ">=18.0.0",
28
28
  "@angular/core": ">=18.0.0",
29
29
  "@browsery/type-is": "^2.0.1",
30
- "@opra/client": "^1.19.5",
30
+ "@opra/client": "^1.20.0",
31
31
  "rxjs": ">=7.8.0 <8",
32
32
  "ts-gems": "^3.11.3"
33
33
  },
34
34
  "devDependencies": {
35
- "@angular-devkit/build-angular": "19.2.15",
36
- "@angular/cli": "19.2.15",
37
- "@angular/compiler": "19.2.14",
38
- "@angular/compiler-cli": "19.2.14",
39
- "@angular/platform-browser": "19.2.14",
40
- "@angular/platform-browser-dynamic": "19.2.14",
41
- "@opra/client": "^1.19.5",
35
+ "@angular-devkit/build-angular": "^21.0.2",
36
+ "@angular/cli": "^21.0.2",
37
+ "@angular/compiler": "^21.0.3",
38
+ "@angular/compiler-cli": "^21.0.3",
39
+ "@angular/platform-browser": "^21.0.3",
40
+ "@angular/platform-browser-dynamic": "^21.0.3",
41
+ "@opra/client": "^1.20.0",
42
42
  "rxjs": "^7.8.2",
43
- "core-js": "^3.46.0",
43
+ "core-js": "^3.47.0",
44
44
  "cross-fetch": "^4.1.0",
45
45
  "expect": "^30.2.0",
46
- "express": "^5.1.0",
47
- "ng-packagr": "19.2.2",
46
+ "express": "^5.2.1",
47
+ "ng-packagr": "^21.0.0",
48
48
  "superagent": "^10.2.3",
49
49
  "supertest": "^7.1.4",
50
- "zone.js": "^0.15.1"
50
+ "zone.js": "^0.16.0"
51
51
  },
52
52
  "type": "module",
53
53
  "repository": {
@@ -1,4 +1,6 @@
1
+ // @ts-ignore
1
2
  import { HttpContext, HttpHeaders, HttpParams } from '@angular/common/http';
3
+ // @ts-ignore
2
4
  import * as Angular from '@angular/common/http';
3
5
  import typeIs from '@browsery/type-is';
4
6
  import {
@@ -232,11 +234,10 @@ export namespace AngularBackend {
232
234
  withCredentials?: boolean;
233
235
  }
234
236
 
235
- export interface RequestOptions
236
- extends Pick<
237
- RequestInit,
238
- 'context' | 'reportProgress' | 'withCredentials'
239
- > {}
237
+ export interface RequestOptions extends Pick<
238
+ RequestInit,
239
+ 'context' | 'reportProgress' | 'withCredentials'
240
+ > {}
240
241
 
241
242
  export type RequestDefaults = StrictOmit<RequestOptions, 'context'> & {
242
243
  headers: Headers;
@@ -1,7 +1,7 @@
1
- /* eslint-disable import-x/extensions */
1
+ // @ts-ignore
2
2
  import { HttpClient } from '@angular/common/http';
3
3
  import { HttpClientBase, kBackend } from '@opra/client';
4
- import { AngularBackend } from './angular-backend';
4
+ import { AngularBackend } from './angular-backend.js';
5
5
 
6
6
  /**
7
7
  *
@@ -1,4 +1,5 @@
1
1
  /* eslint-disable import-x/extensions */
2
+ // @ts-ignore
2
3
  import { HttpClient } from '@angular/common/http';
3
4
  import {
4
5
  type ModuleWithProviders,
@@ -1,6 +1,6 @@
1
1
  import { InjectionToken, NgModule, Type } from '@angular/core';
2
2
  import type { StrictOmit } from 'ts-gems';
3
- import { AngularBackend } from '../angular-backend.js';
3
+ import type { AngularBackend } from '../angular-backend';
4
4
 
5
5
  export type OpraClientModuleOptions = AngularBackend.Options & {
6
6
  serviceUrl: string;
@@ -13,8 +13,10 @@ export interface OpraModuleOptionsFactory {
13
13
  createOptions(): Promise<_OpraClientModuleOptions> | _OpraClientModuleOptions;
14
14
  }
15
15
 
16
- export interface OpraClientModuleAsyncOptions
17
- extends Pick<NgModule, 'imports' | 'providers'> {
16
+ export interface OpraClientModuleAsyncOptions extends Pick<
17
+ NgModule,
18
+ 'imports' | 'providers'
19
+ > {
18
20
  token?: string | InjectionToken<any>;
19
21
  useExisting?: Type<OpraModuleOptionsFactory>;
20
22
  useClass?: Type<any>;
@@ -1,40 +0,0 @@
1
- import { HttpContext, HttpParams } from '@angular/common/http';
2
- import * as Angular from '@angular/common/http';
3
- import { HttpBackend, type HttpEvent, HttpResponse } from '@opra/client';
4
- import { Observable } from 'rxjs';
5
- import type { StrictOmit } from 'ts-gems';
6
- /**
7
- *
8
- * @class AngularBackend
9
- */
10
- export declare class AngularBackend extends HttpBackend {
11
- readonly httpClient: Angular.HttpClient;
12
- defaults: AngularBackend.RequestDefaults;
13
- constructor(httpClient: Angular.HttpClient, serviceUrl: string, options?: AngularBackend.Options);
14
- handle(init: AngularBackend.RequestInit): Observable<HttpEvent>;
15
- protected send(request: Angular.HttpRequest<any>): Observable<Angular.HttpEvent<unknown>>;
16
- protected prepareRequest(init: AngularBackend.RequestInit): AngularBackend.RequestInit;
17
- protected createResponse(init: HttpResponse.Initiator): HttpResponse;
18
- protected parseBody(fetchResponse: Response): Promise<any>;
19
- }
20
- /**
21
- * @namespace AngularBackend
22
- */
23
- export declare namespace AngularBackend {
24
- interface Options extends HttpBackend.Options {
25
- defaults?: RequestDefaults;
26
- }
27
- interface RequestInit extends HttpBackend.RequestInit {
28
- context?: HttpContext;
29
- reportProgress?: boolean;
30
- params?: HttpParams;
31
- responseType?: 'arraybuffer' | 'blob' | 'json' | 'text';
32
- withCredentials?: boolean;
33
- }
34
- interface RequestOptions extends Pick<RequestInit, 'context' | 'reportProgress' | 'withCredentials'> {
35
- }
36
- type RequestDefaults = StrictOmit<RequestOptions, 'context'> & {
37
- headers: Headers;
38
- params: URLSearchParams;
39
- };
40
- }
@@ -1,12 +0,0 @@
1
- import { HttpClient } from '@angular/common/http';
2
- import { HttpClientBase, kBackend } from '@opra/client';
3
- import { AngularBackend } from './angular-backend';
4
- /**
5
- *
6
- * @class OpraAngularClient
7
- */
8
- export declare class OpraAngularClient extends HttpClientBase<AngularBackend.RequestOptions> {
9
- [kBackend]: AngularBackend;
10
- constructor(httpClient: HttpClient, serviceUrl: string, options?: AngularBackend.Options);
11
- get defaults(): AngularBackend.RequestDefaults;
12
- }
@@ -1,14 +0,0 @@
1
- import { type ModuleWithProviders, Type } from '@angular/core';
2
- import type { OpraClientModuleAsyncOptions, OpraClientModuleOptions } from './interfaces/module-options.interface';
3
- import * as i0 from "@angular/core";
4
- export declare class OpraClientModule {
5
- static registerClient(options: OpraClientModuleOptions): ModuleWithProviders<OpraClientModule>;
6
- static registerService<T>(serviceClass: Type<T>, options: OpraClientModuleOptions): ModuleWithProviders<OpraClientModule>;
7
- static registerClientAsync(options: OpraClientModuleAsyncOptions): ModuleWithProviders<OpraClientModule>;
8
- static registerServiceAsync<T>(serviceClass: Type<T>, options: OpraClientModuleAsyncOptions): ModuleWithProviders<OpraClientModule>;
9
- private static _createAsyncProviders;
10
- private static _createAsyncOptionsProvider;
11
- static ɵfac: i0.ɵɵFactoryDeclaration<OpraClientModule, never>;
12
- static ɵmod: i0.ɵɵNgModuleDeclaration<OpraClientModule, never, never, never>;
13
- static ɵinj: i0.ɵɵInjectorDeclaration<OpraClientModule>;
14
- }
@@ -1 +0,0 @@
1
- export declare const OPRA_CLIENT_MODULE_OPTIONS = "OPRA_CLIENT_MODULE_OPTIONS";
package/build/index.d.ts DELETED
@@ -1,5 +0,0 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- /// <amd-module name="@opra/angular" />
5
- export * from './public_api';
@@ -1,19 +0,0 @@
1
- import { InjectionToken, NgModule, Type } from '@angular/core';
2
- import type { StrictOmit } from 'ts-gems';
3
- import { AngularBackend } from '../angular-backend.js';
4
- export type OpraClientModuleOptions = AngularBackend.Options & {
5
- serviceUrl: string;
6
- token?: string | InjectionToken<any>;
7
- };
8
- type _OpraClientModuleOptions = StrictOmit<OpraClientModuleOptions, 'token'>;
9
- export interface OpraModuleOptionsFactory {
10
- createOptions(): Promise<_OpraClientModuleOptions> | _OpraClientModuleOptions;
11
- }
12
- export interface OpraClientModuleAsyncOptions extends Pick<NgModule, 'imports' | 'providers'> {
13
- token?: string | InjectionToken<any>;
14
- useExisting?: Type<OpraModuleOptionsFactory>;
15
- useClass?: Type<any>;
16
- useFactory?: (...args: any[]) => Promise<_OpraClientModuleOptions> | _OpraClientModuleOptions;
17
- deps?: any[];
18
- }
19
- export {};
@@ -1,4 +0,0 @@
1
- export * from './angular-backend';
2
- export * from './client.module';
3
- export * from './constants';
4
- export * from './interfaces/module-options.interface';