feature/upgrade #12

Merged
manuel merged 67 commits from feature/upgrade into master 2024-01-28 00:13:54 +01:00
13 changed files with 46 additions and 26 deletions
Showing only changes of commit 9e11ba9335 - Show all commits

View file

@ -3,7 +3,7 @@ import {NgModule} from '@angular/core';
import {AppComponent} from './app.component'; import {AppComponent} from './app.component';
import {ConverterRegistryService} from './converter-registry.service'; import {ConverterRegistryService} from './converter-registry.service';
import {InputComponentManagerService} from './input-component-manager.service'; import {InputComponentManagerService} from './input-component-manager.service';
import {NativeLibraryWrapperService} from './nativelibrarywrapper.service'; import {NativeLibraryWrapperService} from './native-library-wrapper.service';
import {FormsModule} from '@angular/forms'; import {FormsModule} from '@angular/forms';
import {VersionComponent} from './version/version.component'; import {VersionComponent} from './version/version.component';

View file

@ -8,7 +8,7 @@ import {HexToDecConverter} from './converter/hextodecconverter';
import {HTMLEntitiesDecoder} from './converter/htmlentitiesdecoder'; import {HTMLEntitiesDecoder} from './converter/htmlentitiesdecoder';
import {HTMLEntitiesEncoder} from './converter/htmlentitiesencoder'; import {HTMLEntitiesEncoder} from './converter/htmlentitiesencoder';
import {Injectable} from '@angular/core'; import {Injectable} from '@angular/core';
import {NativeLibraryWrapperService} from './nativelibrarywrapper.service'; import {NativeLibraryWrapperService} from './native-library-wrapper.service';
import {PunycodeDecoder} from './converter/punycodedecoder'; import {PunycodeDecoder} from './converter/punycodedecoder';
import {PunycodeEncoder} from './converter/punycodeencoder'; import {PunycodeEncoder} from './converter/punycodeencoder';
import {QuotedPrintableDecoder} from './converter/quotedprintabledecoder'; import {QuotedPrintableDecoder} from './converter/quotedprintabledecoder';

View file

@ -1,5 +1,5 @@
import {Converter} from './converter'; import {Converter} from './converter';
import {NativeLibraryWrapperService} from '../nativelibrarywrapper.service'; import {NativeLibraryWrapperService} from '../native-library-wrapper.service';
export class PunycodeDecoder implements Converter { export class PunycodeDecoder implements Converter {

View file

@ -1,5 +1,5 @@
import {Converter} from './converter'; import {Converter} from './converter';
import {NativeLibraryWrapperService} from '../nativelibrarywrapper.service'; import {NativeLibraryWrapperService} from '../native-library-wrapper.service';
export class PunycodeEncoder implements Converter { export class PunycodeEncoder implements Converter {

View file

@ -1,5 +1,5 @@
import {Converter} from './converter'; import {Converter} from './converter';
import {NativeLibraryWrapperService} from '../nativelibrarywrapper.service'; import {NativeLibraryWrapperService} from '../native-library-wrapper.service';
export class QuotedPrintableDecoder implements Converter { export class QuotedPrintableDecoder implements Converter {

View file

@ -1,5 +1,5 @@
import {Converter} from './converter'; import {Converter} from './converter';
import {NativeLibraryWrapperService} from '../nativelibrarywrapper.service'; import {NativeLibraryWrapperService} from '../native-library-wrapper.service';
export class QuotedPrintableEncoder implements Converter { export class QuotedPrintableEncoder implements Converter {

View file

@ -1,5 +1,5 @@
import {Converter} from './converter'; import {Converter} from './converter';
import {NativeLibraryWrapperService} from '../nativelibrarywrapper.service'; import {NativeLibraryWrapperService} from '../native-library-wrapper.service';
export class UTF8Decoder implements Converter { export class UTF8Decoder implements Converter {

View file

@ -1,5 +1,5 @@
import {Converter} from './converter'; import {Converter} from './converter';
import {NativeLibraryWrapperService} from '../nativelibrarywrapper.service'; import {NativeLibraryWrapperService} from '../native-library-wrapper.service';
export class UTF8Encoder implements Converter { export class UTF8Encoder implements Converter {

View file

@ -0,0 +1,15 @@
import { TestBed, inject } from '@angular/core/testing';
import { NativeLibraryWrapperService } from './native-library-wrapper.service';
describe('NativeLibraryWrapperService', () => {
beforeEach(() => {
TestBed.configureTestingModule({
providers: [NativeLibraryWrapperService]
});
});
it('should be created', inject([NativeLibraryWrapperService], (service: NativeLibraryWrapperService) => {
expect(service).toBeTruthy();
}));
});

View file

@ -1,12 +1,11 @@
import {Injectable} from '@angular/core'; import {Injectable} from '@angular/core';
import {Punycode} from './punycode';
import {Utf8} from './utf8';
import {QuotedPrintable} from './quotedprintable';
import * as NativeUtf8 from 'utf8';
import * as NativeQuotedPrintable from 'quoted-printable';
import * as NativePunycode from 'punycode'; import * as NativePunycode from 'punycode';
import * as NativeQuotedPrintable from 'quoted-printable';
import * as NativeUtf8 from 'utf8';
@Injectable() @Injectable({
providedIn: 'root'
})
export class NativeLibraryWrapperService { export class NativeLibraryWrapperService {
public utf8: Utf8; public utf8: Utf8;
public quotedPrintable: QuotedPrintable; public quotedPrintable: QuotedPrintable;
@ -18,3 +17,21 @@ export class NativeLibraryWrapperService {
this.punycode = NativePunycode; 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;
}

View file

@ -1,4 +0,0 @@
export interface Punycode {
encode(input: string): string;
decode(input: string): string;
}

View file

@ -1,4 +0,0 @@
export interface QuotedPrintable {
encode(input: string): string;
decode(input: string): string;
}

View file

@ -1,4 +0,0 @@
export interface Utf8 {
encode(input: any): string;
decode(input: string): any;
}