@yamlresume/core 0.2.4 → 0.3.1
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 +110 -7
- package/dist/index.js +75 -73
- package/dist/index.js.map +1 -1
- package/package.json +4 -3
package/dist/index.d.ts
CHANGED
|
@@ -668,12 +668,11 @@ declare const spanishCountryNames: Record<Country, string>;
|
|
|
668
668
|
* IN THE SOFTWARE.
|
|
669
669
|
*/
|
|
670
670
|
|
|
671
|
-
/**
|
|
672
|
-
*
|
|
673
|
-
*
|
|
674
|
-
* TODO: should we move this to TypeScript enum?
|
|
671
|
+
/**
|
|
672
|
+
* All valid top-level sections in the resume.
|
|
675
673
|
* */
|
|
676
|
-
|
|
674
|
+
declare const SECTION_IDS: readonly ["basics", "location", "profiles", "work", "education", "volunteer", "awards", "certificates", "publications", "skills", "languages", "interests", "references", "projects"];
|
|
675
|
+
type SectionID = (typeof SECTION_IDS)[number];
|
|
677
676
|
/** Categorizes social networks for potential grouping or display purposes. */
|
|
678
677
|
type SocialNetworkGroup = 'Chat' | 'Design' | 'Media' | 'Social' | 'Technical' | 'WWW';
|
|
679
678
|
/** Defines supported social media and professional network identifiers.
|
|
@@ -710,7 +709,7 @@ type BasicsItem = {
|
|
|
710
709
|
/** Email address. */
|
|
711
710
|
email?: string;
|
|
712
711
|
/** A brief professional headline or title (e.g., "Software Engineer"). */
|
|
713
|
-
headline
|
|
712
|
+
headline?: string;
|
|
714
713
|
/** Full name. */
|
|
715
714
|
name?: string;
|
|
716
715
|
/** Phone number. */
|
|
@@ -1366,6 +1365,94 @@ declare const defaultResume: Resume;
|
|
|
1366
1365
|
*/
|
|
1367
1366
|
declare const filledResume: Resume;
|
|
1368
1367
|
|
|
1368
|
+
/**
|
|
1369
|
+
* Enum of error codes for YAMLResumeError.
|
|
1370
|
+
*
|
|
1371
|
+
* Error codes are used to identify specific errors and can be used to
|
|
1372
|
+
* internationalize error messages.
|
|
1373
|
+
*/
|
|
1374
|
+
declare const ErrorType: {
|
|
1375
|
+
readonly FILE_NOT_FOUND: {
|
|
1376
|
+
readonly code: "FILE_NOT_FOUND";
|
|
1377
|
+
readonly errno: number;
|
|
1378
|
+
readonly message: "Resume not found: {path}";
|
|
1379
|
+
readonly path: "";
|
|
1380
|
+
};
|
|
1381
|
+
readonly FILE_READ_ERROR: {
|
|
1382
|
+
readonly code: "FILE_READ_ERROR";
|
|
1383
|
+
readonly errno: number;
|
|
1384
|
+
readonly message: "Failed to read resume file: {path}";
|
|
1385
|
+
readonly path: "";
|
|
1386
|
+
};
|
|
1387
|
+
readonly FILE_WRITE_ERROR: {
|
|
1388
|
+
readonly code: "FILE_WRITE_ERROR";
|
|
1389
|
+
readonly errno: number;
|
|
1390
|
+
readonly message: "Failed to write file: {path}";
|
|
1391
|
+
readonly path: "";
|
|
1392
|
+
};
|
|
1393
|
+
readonly FILE_CONFLICT: {
|
|
1394
|
+
readonly code: "FILE_CONFLICT";
|
|
1395
|
+
readonly errno: number;
|
|
1396
|
+
readonly message: string;
|
|
1397
|
+
readonly path: "";
|
|
1398
|
+
};
|
|
1399
|
+
readonly INVALID_EXTNAME: {
|
|
1400
|
+
readonly code: "INVALID_EXTNAME";
|
|
1401
|
+
readonly errno: number;
|
|
1402
|
+
readonly message: string;
|
|
1403
|
+
readonly extname: "";
|
|
1404
|
+
};
|
|
1405
|
+
readonly INVALID_YAML: {
|
|
1406
|
+
readonly code: "INVALID_YAML";
|
|
1407
|
+
readonly errno: number;
|
|
1408
|
+
readonly message: "Invalid YAML format: {error}";
|
|
1409
|
+
readonly error: "";
|
|
1410
|
+
};
|
|
1411
|
+
readonly INVALID_JSON: {
|
|
1412
|
+
readonly code: "INVALID_JSON";
|
|
1413
|
+
readonly errno: number;
|
|
1414
|
+
readonly message: "Invalid JSON format: {error}";
|
|
1415
|
+
readonly error: "";
|
|
1416
|
+
};
|
|
1417
|
+
readonly LATEX_NOT_FOUND: {
|
|
1418
|
+
readonly code: "LATEX_NOT_FOUND";
|
|
1419
|
+
readonly errno: number;
|
|
1420
|
+
readonly message: "LaTeX compiler not found. Please install either xelatex or tectonic";
|
|
1421
|
+
};
|
|
1422
|
+
readonly LATEX_COMPILE_ERROR: {
|
|
1423
|
+
readonly code: "LATEX_COMPILE_ERROR";
|
|
1424
|
+
readonly errno: number;
|
|
1425
|
+
readonly message: "LaTeX compilation failed: {error}";
|
|
1426
|
+
readonly error: "";
|
|
1427
|
+
};
|
|
1428
|
+
};
|
|
1429
|
+
/**
|
|
1430
|
+
* Type for the error code.
|
|
1431
|
+
*/
|
|
1432
|
+
type ErrorCodeType = keyof typeof ErrorType;
|
|
1433
|
+
/**
|
|
1434
|
+
* Type for the error message parameters.
|
|
1435
|
+
*/
|
|
1436
|
+
type ErrorMessageParams = {
|
|
1437
|
+
[K in ErrorCodeType]: {
|
|
1438
|
+
[P in keyof (typeof ErrorType)[K] as P extends 'message' | 'code' | 'errno' ? never : P]: string;
|
|
1439
|
+
};
|
|
1440
|
+
};
|
|
1441
|
+
/**
|
|
1442
|
+
* Custom error class for YAMLResume errors.
|
|
1443
|
+
*/
|
|
1444
|
+
declare class YAMLResumeError<T extends ErrorCodeType> extends Error {
|
|
1445
|
+
code: T;
|
|
1446
|
+
errno: number;
|
|
1447
|
+
/**
|
|
1448
|
+
* Constructor for YAMLResumeError.
|
|
1449
|
+
*
|
|
1450
|
+
* @param code - The error code.
|
|
1451
|
+
* @param params - The error message parameters.
|
|
1452
|
+
*/
|
|
1453
|
+
constructor(code: T, params: ErrorMessageParams[T]);
|
|
1454
|
+
}
|
|
1455
|
+
|
|
1369
1456
|
/**
|
|
1370
1457
|
* MIT License
|
|
1371
1458
|
*
|
|
@@ -1848,6 +1935,14 @@ declare function escapeLatex(value: string | null | undefined): any;
|
|
|
1848
1935
|
* @see {@link https://stackoverflow.com/a/43233163}
|
|
1849
1936
|
*/
|
|
1850
1937
|
declare function isEmptyValue(value: undefined | null | object | string): boolean;
|
|
1938
|
+
/**
|
|
1939
|
+
* Remove keys from an object by their names
|
|
1940
|
+
*
|
|
1941
|
+
* @param obj - The object to remove keys from
|
|
1942
|
+
* @param keysToRemove - The keys to remove
|
|
1943
|
+
* @returns The object with the specified keys removed
|
|
1944
|
+
*/
|
|
1945
|
+
declare function removeKeysFromObject<T extends object>(obj: T, keysToRemove: (string | number | symbol)[]): T;
|
|
1851
1946
|
|
|
1852
1947
|
/**
|
|
1853
1948
|
* MIT License
|
|
@@ -1895,5 +1990,13 @@ declare function showIf(predicate: boolean, content: string): string;
|
|
|
1895
1990
|
* @returns The joined string
|
|
1896
1991
|
*/
|
|
1897
1992
|
declare function joinNonEmptyString(codes: string[], separator?: string): string;
|
|
1993
|
+
/**
|
|
1994
|
+
* Convert a string to a code block in markdown format
|
|
1995
|
+
*
|
|
1996
|
+
* @param code - The string to convert
|
|
1997
|
+
* @param lang - The language of the code block
|
|
1998
|
+
* @returns The code block
|
|
1999
|
+
*/
|
|
2000
|
+
declare function toCodeBlock(code?: string, lang?: string): string;
|
|
1898
2001
|
|
|
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 };
|
|
2002
|
+
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, SECTION_IDS, 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, removeKeysFromObject, resumeItems, showIf, simplifiedChineseCountryNames, skillLevelOptions, spanishCountryNames, toCodeBlock, traditionalChineseCountryHKNames, traditionalChineseCountryTWNames, transformResume };
|