瀏覽代碼

Organize exports

Properly define exports.
master
TheoryOfNekomata 8 月之前
父節點
當前提交
3320c11f64
共有 3 個檔案被更改,包括 7 行新增8 行删除
  1. +6
    -7
      src/common/app.ts
  2. +1
    -0
      src/common/index.ts
  3. +0
    -1
      src/index.ts

+ 6
- 7
src/common/app.ts 查看文件

@@ -1,11 +1,10 @@
import {Resource} from './resource';
import {Language} from './language';
import {MediaType} from './media-type';
import {Charset} from './charset';
import {FALLBACK_LANGUAGE, Language} from './language';
import {FALLBACK_MEDIA_TYPE, MediaType} from './media-type';
import {Charset, FALLBACK_CHARSET} from './charset';
import * as v from 'valibot';
import {BackendBuilder, createBackend, CreateBackendParams} from '../backend';
import {ClientBuilder, createClient, CreateClientParams} from '../client';
import {FALLBACK_CHARSET, FALLBACK_LANGUAGE, FALLBACK_MEDIA_TYPE} from './index';

type ApplicationMap<T extends { name: string }> = Map<T['name'], T>;

@@ -34,13 +33,13 @@ export const application = (appParams: ApplicationParams): ApplicationBuilder =>
const appState: ApplicationState = {
name: appParams.name,
resources: new Set<Resource<any>>(),
languages: new Map<Language["name"], Language>([
languages: new Map<Language['name'], Language>([
[FALLBACK_LANGUAGE.name, FALLBACK_LANGUAGE],
]),
mediaTypes: new Map<MediaType["name"], MediaType>([
mediaTypes: new Map<MediaType['name'], MediaType>([
[FALLBACK_MEDIA_TYPE.name, FALLBACK_MEDIA_TYPE],
]),
charsets: new Map<Charset["name"], Charset>([
charsets: new Map<Charset['name'], Charset>([
[FALLBACK_CHARSET.name, FALLBACK_CHARSET],
]),
};


+ 1
- 0
src/common/index.ts 查看文件

@@ -7,6 +7,7 @@ export * from './charset';
export * from './media-type';
export * from './resource';
export * from './language';
export * as validation from './validation';

export interface ContentNegotiation {
language: Language;


+ 0
- 1
src/index.ts 查看文件

@@ -1,4 +1,3 @@
export * from './common';
export * as validation from './common/validation';

export * as dataSources from './backend/data-sources';

Loading…
取消
儲存