Skip to content

Commit

Permalink
fix: TS4058 - Return type of exported function has or is using name X…
Browse files Browse the repository at this point in the history
… from external module Y but cannot be named
  • Loading branch information
kabeep committed May 7, 2024
1 parent 825c7df commit 9be286c
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 8 deletions.
10 changes: 9 additions & 1 deletion src/core/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
export { default as iso6391X, type LanguageCode, type LanguageOption } from './iso-639-1-x.js';
export { default as parse, type TranslationOption } from './parse.js';
export {
default as parse,
type TranslationOption,
type TranslationOptionFrom,
type TranslationOptionFromLanguage,
type TranslationOptionFromText,
type TranslationOptionTo,
type TranslationOptionToText,
} from './parse.js';
export { default as translate, type TranslateOptions } from './translate.js';
export { default as validate } from './validate.js';
10 changes: 5 additions & 5 deletions src/core/parse.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { mutable } from '../helper/index.js';
import type { ResponseBody } from '../shared/index.js';

interface TranslationOptionFromLanguage {
export interface TranslationOptionFromLanguage {
/** Indicates whether there is a language suggestion */
didYouMean: boolean;
/** The ISO code of the detected language */
iso: string;
}

interface TranslationOptionFromText {
export interface TranslationOptionFromText {
/** Indicates whether there was an autocorrection */
autoCorrected: boolean;
/** Source text */
Expand All @@ -19,7 +19,7 @@ interface TranslationOptionFromText {
didYouMean: boolean;
}

interface TranslationOptionFrom {
export interface TranslationOptionFrom {
language: TranslationOptionFromLanguage;
text: TranslationOptionFromText;
/** Synonyms of the source word */
Expand All @@ -28,14 +28,14 @@ interface TranslationOptionFrom {
sentences: string[];
}

interface TranslationOptionToText {
export interface TranslationOptionToText {
/** Phonetic transcription of the translated text */
phonetics: string;
/** Translated text */
value: string;
}

interface TranslationOptionTo {
export interface TranslationOptionTo {
text: TranslationOptionToText;
/** Polysemy information for the translated text */
polysemy: Array<{ label: string; children: string[] }>;
Expand Down
14 changes: 12 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
export type { TranslateErrorCodes } from './shared/index.js';
export type { ResponseBody as TranslateRawBody, TranslateErrorCodes } from './shared/index.js';

export type { LanguageCode, LanguageOption, TranslateOptions, TranslationOption } from './core/index.js';
export type {
LanguageCode,
LanguageOption,
TranslateOptions,
TranslationOption,
TranslationOptionFrom,
TranslationOptionFromLanguage,
TranslationOptionFromText,
TranslationOptionTo,
TranslationOptionToText,
} from './core/index.js';
export { iso6391X, translate as default } from './core/index.js';

0 comments on commit 9be286c

Please sign in to comment.