@recursyve/nice-ui-kit.v2 13.1.0-beta.86 → 13.1.0-beta.89

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,3 @@
1
+ export declare abstract class NiceApiException<Code> {
2
+ abstract code: Code;
3
+ }
@@ -0,0 +1,6 @@
1
+ import { HttpErrorResponse } from "@angular/common/http";
2
+ import { NiceApiException } from "./api.exception";
3
+ export declare abstract class NiceHttpExceptionFactory<Code = any> {
4
+ transform(error: HttpErrorResponse): NiceApiException<Code> | HttpErrorResponse;
5
+ protected abstract transformCodeError(code: Code, data: any): NiceApiException<Code>;
6
+ }
@@ -0,0 +1 @@
1
+ export * from "./public-api";
@@ -0,0 +1,9 @@
1
+ import { HttpContextToken, HttpHandler, HttpInterceptor, HttpRequest, HttpResponse } from "@angular/common/http";
2
+ import { Type } from "@angular/core";
3
+ import * as i0 from "@angular/core";
4
+ export declare const TRANSFORM_TYPE: HttpContextToken<Type<any>>;
5
+ export declare class NiceTransformResponseInterceptor implements HttpInterceptor {
6
+ intercept(req: HttpRequest<any>, next: HttpHandler): import("rxjs").Observable<import("@angular/common/http").HttpSentEvent | import("@angular/common/http").HttpHeaderResponse | import("@angular/common/http").HttpProgressEvent | HttpResponse<any> | import("@angular/common/http").HttpUserEvent<any>>;
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<NiceTransformResponseInterceptor, never>;
8
+ static ɵprov: i0.ɵɵInjectableDeclaration<NiceTransformResponseInterceptor>;
9
+ }
@@ -0,0 +1,32 @@
1
+ import { HttpClient, HttpContext, HttpHeaders, HttpParams } from "@angular/common/http";
2
+ import { Type } from "@angular/core";
3
+ import { Observable } from "rxjs";
4
+ import { AbstractConstructor, Constructor } from "../types/constructor";
5
+ import { NiceHttpExceptionFactory } from "./exceptions/exception.factory";
6
+ export interface HttpOptions {
7
+ type?: Type<any>;
8
+ context?: HttpContext;
9
+ headers?: HttpHeaders | {
10
+ [header: string]: string | string[];
11
+ };
12
+ params?: HttpParams | {
13
+ [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
14
+ };
15
+ }
16
+ export interface NiceApiDefinition {
17
+ url(route?: string): string;
18
+ delete<T>(route?: string, options?: HttpOptions): Observable<T>;
19
+ get<T>(route?: string, options?: HttpOptions): Observable<T>;
20
+ patch<T>(route?: string, body?: any, options?: HttpOptions): Observable<T>;
21
+ post<T>(route?: string, body?: any, options?: HttpOptions): Observable<T>;
22
+ put<T>(route?: string, body?: any, options?: HttpOptions): Observable<T>;
23
+ }
24
+ export interface HasNiceApiDefinition {
25
+ exceptionFactory: NiceHttpExceptionFactory;
26
+ httpClient: HttpClient;
27
+ apiUrl: string;
28
+ path: string;
29
+ }
30
+ declare type NiceApiDefinitionCtor = Constructor<NiceApiDefinition> & AbstractConstructor<NiceApiDefinition>;
31
+ export declare function mixinNiceApi<C extends AbstractConstructor<HasNiceApiDefinition>>(base: C): NiceApiDefinitionCtor & C;
32
+ export {};
@@ -0,0 +1,4 @@
1
+ export * from "./exceptions/api.exception";
2
+ export * from "./exceptions/exception.factory";
3
+ export * from "./interceptors/transform-response.interceptor";
4
+ export * from "./nice.api";
@@ -87,7 +87,7 @@ export declare class NiceAsyncTypeaheadComponent extends _BaseAsyncTypeaheadComp
87
87
  ngOnDestroy(): void;
88
88
  ngOnChanges(changes: SimpleChanges): void;
89
89
  ngDoCheck(): void;
90
- writeValue(value: any): void;
90
+ writeValue(value: any): Promise<void>;
91
91
  registerOnChange(propagate: (value: string) => void): void;
92
92
  registerOnTouched(fn: any): void;
93
93
  onContainerClick(event: MouseEvent): void;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * From @angular/material/core/common-behaviors/constructor.ts
3
+ */
4
+ export declare type Constructor<T> = new (...args: any[]) => T;
5
+ export declare type AbstractConstructor<T = object> = abstract new (...args: any[]) => T;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@recursyve/nice-ui-kit.v2",
3
- "version": "13.1.0-beta.86",
3
+ "version": "13.1.0-beta.89",
4
4
  "exports": {
5
5
  ".": {
6
6
  "sass": "./_index.scss",
@@ -29,7 +29,8 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "tslib": "^2.0.0",
32
- "lottie-web": "~5.7.1"
32
+ "lottie-web": "~5.7.1",
33
+ "class-transformer": "^0.5.1"
33
34
  },
34
35
  "module": "fesm2015/recursyve-nice-ui-kit.v2.mjs",
35
36
  "es2020": "fesm2020/recursyve-nice-ui-kit.v2.mjs",
package/public-api.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from "./lib/animations";
2
+ export * from "./lib/api";
2
3
  export * from "./lib/components";
3
4
  export * from "./lib/directives";
4
5
  export * from "./lib/pipes";