Corrected NativeLibraryWrapperService.
This commit is contained in:
parent
82c371956b
commit
9e11ba9335
13 changed files with 46 additions and 26 deletions
37
src/app/native-library-wrapper.service.ts
Normal file
37
src/app/native-library-wrapper.service.ts
Normal file
|
@ -0,0 +1,37 @@
|
|||
import {Injectable} from '@angular/core';
|
||||
import * as NativePunycode from 'punycode';
|
||||
import * as NativeQuotedPrintable from 'quoted-printable';
|
||||
import * as NativeUtf8 from 'utf8';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class NativeLibraryWrapperService {
|
||||
public utf8: Utf8;
|
||||
public quotedPrintable: QuotedPrintable;
|
||||
public punycode: Punycode;
|
||||
|
||||
constructor() {
|
||||
this.utf8 = NativeUtf8;
|
||||
this.quotedPrintable = NativeQuotedPrintable;
|
||||
this.punycode = NativePunycode;
|
||||
}
|
||||
}
|
||||
|
||||
interface Punycode {
|
||||
encode(input: string): string;
|
||||
|
||||
decode(input: string): string;
|
||||
}
|
||||
|
||||
interface QuotedPrintable {
|
||||
encode(input: string): string;
|
||||
|
||||
decode(input: string): string;
|
||||
}
|
||||
|
||||
interface Utf8 {
|
||||
encode(input: any): string;
|
||||
|
||||
decode(input: string): any;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue