Skip to content

Commit

Permalink
fix: delete unnecessary types
Browse files Browse the repository at this point in the history
  • Loading branch information
ChoGathK committed Sep 7, 2022
1 parent e6877c5 commit 41c6747
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 17 deletions.
6 changes: 3 additions & 3 deletions src/common/interface/remote-config.ts
@@ -1,7 +1,7 @@
export interface RemoteConfigClient {
init: (...args: any[]) => Promise<any>;
close: (...args: any[]) => Promise<void>;
sync: (...args: any[]) => Promise<any>;
close: (...args: any[]) => Promise<any>;
init: <T = any>(...args: any[]) => Promise<Partial<T>>;
sync: <T = any>(...args: any[]) => Promise<Partial<T>>;
subscribe?: (key: string, callback: (value: any) => any) => Promise<void>;
}

Expand Down
16 changes: 2 additions & 14 deletions test/decorator.spec.ts
Expand Up @@ -4,7 +4,7 @@
import * as request from 'supertest';
import { Test } from '@nestjs/testing';
import { describe, it, expect, beforeEach } from '@jest/globals';
import { Controller, FactoryProvider, Get, Injectable } from '@nestjs/common';
import { Controller, Get, Injectable } from '@nestjs/common';

import {
Api,
Expand All @@ -18,7 +18,6 @@ import {
} from '../src';

@AsyncInjectable
// @ts-ignore
class AsyncNameProvider extends AsyncProvider implements AsyncProviderFactory {
public create = () => ({
inject: [NameInfrastructureProvider],
Expand All @@ -30,21 +29,17 @@ class AsyncNameProvider extends AsyncProvider implements AsyncProviderFactory {
}

@Injectable()
// @ts-ignore
class NameInfrastructureProvider {
public get() { return 'InfrastructureProvider' }
}

@Infrastructure({ export: [NameInfrastructureProvider], provider: [NameInfrastructureProvider] })
// @ts-ignore
class NameInfrastructure {}

@Injectable()
// @ts-ignore
class NameProvider {
constructor(
private readonly name: NameInfrastructureProvider,
// @ts-ignore
@AsyncInject(AsyncNameProvider) private readonly asyncName: any,
) {}

Expand All @@ -58,7 +53,6 @@ class NameProvider {
}

@Injectable()
// @ts-ignore
class NameService {
constructor(private readonly name: NameProvider) {}

Expand All @@ -71,37 +65,31 @@ class NameService {
}

@Domain({ service: [NameService], import: [NameInfrastructure], provider: [NameProvider, new AsyncNameProvider().create()] })
// @ts-ignore
class NameDomain {}


@Controller('name')
// @ts-ignore
class NameController {
constructor(private readonly name: NameService) {}

@Get()
// @ts-ignore
get() {
return { data: this.name.get() };
}
}

@Api({ import: [NameDomain], controller: [NameController] })
// @ts-ignore
class NameApi {}

@Container({ api: [NameApi] })
// @ts-ignore
class AppModule {}


@Container({})
@Api({ controller: [] })
@Domain({ service: [] })
@Infrastructure({ provider: [] })
// @ts-ignore
class Demo {}
export class Demo {}

let app: any;

Expand Down

0 comments on commit 41c6747

Please sign in to comment.