@yamlresume/core 0.2.3 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +97 -1
- package/dist/index.js +66 -64
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1366,6 +1366,94 @@ declare const defaultResume: Resume;
|
|
|
1366
1366
|
*/
|
|
1367
1367
|
declare const filledResume: Resume;
|
|
1368
1368
|
|
|
1369
|
+
/**
|
|
1370
|
+
* Enum of error codes for YAMLResumeError.
|
|
1371
|
+
*
|
|
1372
|
+
* Error codes are used to identify specific errors and can be used to
|
|
1373
|
+
* internationalize error messages.
|
|
1374
|
+
*/
|
|
1375
|
+
declare const ErrorType: {
|
|
1376
|
+
readonly FILE_NOT_FOUND: {
|
|
1377
|
+
readonly code: "FILE_NOT_FOUND";
|
|
1378
|
+
readonly errno: number;
|
|
1379
|
+
readonly message: "Resume not found: {path}";
|
|
1380
|
+
readonly path: "";
|
|
1381
|
+
};
|
|
1382
|
+
readonly FILE_READ_ERROR: {
|
|
1383
|
+
readonly code: "FILE_READ_ERROR";
|
|
1384
|
+
readonly errno: number;
|
|
1385
|
+
readonly message: "Failed to read resume file: {path}";
|
|
1386
|
+
readonly path: "";
|
|
1387
|
+
};
|
|
1388
|
+
readonly FILE_WRITE_ERROR: {
|
|
1389
|
+
readonly code: "FILE_WRITE_ERROR";
|
|
1390
|
+
readonly errno: number;
|
|
1391
|
+
readonly message: "Failed to write file: {path}";
|
|
1392
|
+
readonly path: "";
|
|
1393
|
+
};
|
|
1394
|
+
readonly FILE_CONFLICT: {
|
|
1395
|
+
readonly code: "FILE_CONFLICT";
|
|
1396
|
+
readonly errno: number;
|
|
1397
|
+
readonly message: string;
|
|
1398
|
+
readonly path: "";
|
|
1399
|
+
};
|
|
1400
|
+
readonly INVALID_EXTNAME: {
|
|
1401
|
+
readonly code: "INVALID_EXTNAME";
|
|
1402
|
+
readonly errno: number;
|
|
1403
|
+
readonly message: string;
|
|
1404
|
+
readonly extname: "";
|
|
1405
|
+
};
|
|
1406
|
+
readonly INVALID_YAML: {
|
|
1407
|
+
readonly code: "INVALID_YAML";
|
|
1408
|
+
readonly errno: number;
|
|
1409
|
+
readonly message: "Invalid YAML format: {error}";
|
|
1410
|
+
readonly error: "";
|
|
1411
|
+
};
|
|
1412
|
+
readonly INVALID_JSON: {
|
|
1413
|
+
readonly code: "INVALID_JSON";
|
|
1414
|
+
readonly errno: number;
|
|
1415
|
+
readonly message: "Invalid JSON format: {error}";
|
|
1416
|
+
readonly error: "";
|
|
1417
|
+
};
|
|
1418
|
+
readonly LATEX_NOT_FOUND: {
|
|
1419
|
+
readonly code: "LATEX_NOT_FOUND";
|
|
1420
|
+
readonly errno: number;
|
|
1421
|
+
readonly message: "LaTeX compiler not found. Please install either xelatex or tectonic";
|
|
1422
|
+
};
|
|
1423
|
+
readonly LATEX_COMPILE_ERROR: {
|
|
1424
|
+
readonly code: "LATEX_COMPILE_ERROR";
|
|
1425
|
+
readonly errno: number;
|
|
1426
|
+
readonly message: "LaTeX compilation failed: {error}";
|
|
1427
|
+
readonly error: "";
|
|
1428
|
+
};
|
|
1429
|
+
};
|
|
1430
|
+
/**
|
|
1431
|
+
* Type for the error code.
|
|
1432
|
+
*/
|
|
1433
|
+
type ErrorCodeType = keyof typeof ErrorType;
|
|
1434
|
+
/**
|
|
1435
|
+
* Type for the error message parameters.
|
|
1436
|
+
*/
|
|
1437
|
+
type ErrorMessageParams = {
|
|
1438
|
+
[K in ErrorCodeType]: {
|
|
1439
|
+
[P in keyof (typeof ErrorType)[K] as P extends 'message' | 'code' | 'errno' ? never : P]: string;
|
|
1440
|
+
};
|
|
1441
|
+
};
|
|
1442
|
+
/**
|
|
1443
|
+
* Custom error class for YAMLResume errors.
|
|
1444
|
+
*/
|
|
1445
|
+
declare class YAMLResumeError<T extends ErrorCodeType> extends Error {
|
|
1446
|
+
code: T;
|
|
1447
|
+
errno: number;
|
|
1448
|
+
/**
|
|
1449
|
+
* Constructor for YAMLResumeError.
|
|
1450
|
+
*
|
|
1451
|
+
* @param code - The error code.
|
|
1452
|
+
* @param params - The error message parameters.
|
|
1453
|
+
*/
|
|
1454
|
+
constructor(code: T, params: ErrorMessageParams[T]);
|
|
1455
|
+
}
|
|
1456
|
+
|
|
1369
1457
|
/**
|
|
1370
1458
|
* MIT License
|
|
1371
1459
|
*
|
|
@@ -1895,5 +1983,13 @@ declare function showIf(predicate: boolean, content: string): string;
|
|
|
1895
1983
|
* @returns The joined string
|
|
1896
1984
|
*/
|
|
1897
1985
|
declare function joinNonEmptyString(codes: string[], separator?: string): string;
|
|
1986
|
+
/**
|
|
1987
|
+
* Convert a string to a code block in markdown format
|
|
1988
|
+
*
|
|
1989
|
+
* @param code - The string to convert
|
|
1990
|
+
* @param lang - The language of the code block
|
|
1991
|
+
* @returns The code block
|
|
1992
|
+
*/
|
|
1993
|
+
declare function toCodeBlock(code?: string, lang?: string): string;
|
|
1898
1994
|
|
|
1899
|
-
export { type Awards, type Basics, type BulletListNode, type Certificates, Country, Degree, type DocNode, type Education, FontSpecNumbersStyle, type Interests, Language, LanguageFluency, type LanguageItem, type Languages, LatexCodeGenerator, LocaleLanguageOption, type Location, MarkdownParser, type Node, type OrderedListNode, type ParagraphNode, type Parser, type ProfileItem, type Profiles, type Projects, type Publications, Punctuation, type References, type Resume, type ResumeContent, type ResumeItem, type ResumeLayout, ResumeTerms, type SectionDefaultValues, type SectionID, SkillLevel, type Skills, type SocialNetwork, type SocialNetworkGroup, TemplateOption, TemplateTerms, type TextNode, TiptapParser, type Volunteer, type Work, defaultResume, defaultResumeContent, defaultResumeLayout, degreeOptions, emptyParagraph, englishCountryNames, epochSecondsToLocaleDateString, escapeLatex, filledResume, filledResumeContent, fontSizeOptions, getDateRange, getLocaleLanguageOptionDetail, getResumeRenderer, getTemplateOptionDetail, getTemplateTranslations, getTermsTranslations, isEmptyString, isEmptyValue, joinNonEmptyString, languageFluenciesOptions, languagesOptions, localizeDate, marginOptions, milliSecondsToSeconds, nowInUTCSeconds, oneDay, parseDate, resumeItems, showIf, simplifiedChineseCountryNames, skillLevelOptions, spanishCountryNames, traditionalChineseCountryHKNames, traditionalChineseCountryTWNames, transformResume };
|
|
1995
|
+
export { type Awards, type Basics, type BulletListNode, type Certificates, Country, Degree, type DocNode, type Education, ErrorType, FontSpecNumbersStyle, type Interests, Language, LanguageFluency, type LanguageItem, type Languages, LatexCodeGenerator, LocaleLanguageOption, type Location, MarkdownParser, type Node, type OrderedListNode, type ParagraphNode, type Parser, type ProfileItem, type Profiles, type Projects, type Publications, Punctuation, type References, type Resume, type ResumeContent, type ResumeItem, type ResumeLayout, ResumeTerms, type SectionDefaultValues, type SectionID, SkillLevel, type Skills, type SocialNetwork, type SocialNetworkGroup, TemplateOption, TemplateTerms, type TextNode, TiptapParser, type Volunteer, type Work, YAMLResumeError, defaultResume, defaultResumeContent, defaultResumeLayout, degreeOptions, emptyParagraph, englishCountryNames, epochSecondsToLocaleDateString, escapeLatex, filledResume, filledResumeContent, fontSizeOptions, getDateRange, getLocaleLanguageOptionDetail, getResumeRenderer, getTemplateOptionDetail, getTemplateTranslations, getTermsTranslations, isEmptyString, isEmptyValue, joinNonEmptyString, languageFluenciesOptions, languagesOptions, localizeDate, marginOptions, milliSecondsToSeconds, nowInUTCSeconds, oneDay, parseDate, resumeItems, showIf, simplifiedChineseCountryNames, skillLevelOptions, spanishCountryNames, toCodeBlock, traditionalChineseCountryHKNames, traditionalChineseCountryTWNames, transformResume };
|