import { Paragraph, TextRun, ExternalHyperlink, Document } from 'docx'; import { z } from 'zod'; /** * MIT License * * Copyright (c) 2023–Present PPResume (https://ppresume.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ /** Represents a bold formatting mark. */ type BoldMark = { type: 'bold'; }; /** Represents a link mark with optional attributes. */ type LinkMark = { /** Optional attributes for the link. */ attrs?: { /** The URL the link points to. */ href: string; /** CSS class attribute, typically null. */ class: string | null; /** Link target attribute (e.g., '_blank'), often null or empty. */ target: string; }; type: 'link'; }; /** Represents an italic formatting mark. */ type ItalicMark = { type: 'italic'; }; /** Represents a union of all possible inline formatting marks. */ type Mark = BoldMark | ItalicMark | LinkMark; /** Represents a sequence of child nodes, often used for block node content. */ type Fragment = Node[] | undefined; /** Represents a bullet list node (unordered list). */ type BulletListNode = { /** Child nodes (typically ListItemNode) contained within this list. */ content?: Fragment; type: 'bulletList'; /** Optional attributes, typically only includes 'start' which defaults to 1 * but isn't semantically used for bullet lists. */ attrs?: { start: 1; }; }; /** Represents the root node of the document tree. */ type DocNode = { /** The top-level block nodes (like ParagraphNode, BulletListNode, etc.) of the * document. */ content?: Fragment; type: 'doc'; }; /** Represents an item within a list (either bullet or ordered). */ type ListItemNode = { /** Child nodes (like ParagraphNode) contained within this list item. */ content?: Fragment; type: 'listItem'; }; /** Represents an ordered list node. */ type OrderedListNode = { /** Child nodes (typically ListItemNode) contained within this list. */ content?: Fragment; type: 'orderedList'; /** Optional attributes for the list. */ attrs?: { /** The starting number for the ordered list. */ start: number; }; }; /** Represents a paragraph block node. */ type ParagraphNode = { /** Inline child nodes (like TextNode) contained within this paragraph. */ content?: Fragment; type: 'paragraph'; }; /** Represents a plain text node, with optional associated formatting marks. */ type TextNode = { /** Optional formatting marks (like BoldMark, LinkMark) applied to this text * span. */ marks?: Mark[]; /** The actual text content. */ text: string; type: 'text'; }; /** * Represents a union of all possible node types in the document tree. * * These node types are inspired by the Tiptap editor. * * @see {@link https://tiptap.dev/docs/editor/core-concepts/schema} **/ type Node = BulletListNode | DocNode | ListItemNode | OrderedListNode | ParagraphNode | TextNode; /** * MIT License * * Copyright (c) 2023–Present PPResume (https://ppresume.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ /** * All possible countries and regions in the world. */ declare const COUNTRY_OPTIONS: readonly ["Afghanistan", "Aland Islands", "Albania", "Algeria", "American Samoa", "Andorra", "Angola", "Anguilla", "Antarctica", "Antigua And Barbuda", "Argentina", "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", "Bonaire, Sint Eustatius and Saba", "Bosnia and Herzegovina", "Botswana", "Bouvet Island", "Brazil", "British Indian Ocean Territory", "Brunei", "Bulgaria", "Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Cayman Islands", "Central African Republic", "Chad", "Chile", "China", "Christmas Island", "Cocos (Keeling) Islands", "Colombia", "Comoros", "Congo", "Cook Islands", "Costa Rica", "Cote D'Ivoire (Ivory Coast)", "Croatia", "Cuba", "Curaçao", "Cyprus", "Czech Republic", "Democratic Republic of the Congo", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "East Timor", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Falkland Islands", "Faroe Islands", "Fiji Islands", "Finland", "France", "French Guiana", "French Polynesia", "French Southern Territories", "Gabon", "Gambia The", "Georgia", "Germany", "Ghana", "Gibraltar", "Greece", "Greenland", "Grenada", "Guadeloupe", "Guam", "Guatemala", "Guernsey and Alderney", "Guinea", "Guinea-Bissau", "Guyana", "Haiti", "Heard Island and McDonald Islands", "Honduras", "Hong Kong", "Hungary", "Iceland", "India", "Indonesia", "Iran", "Iraq", "Ireland", "Israel", "Italy", "Jamaica", "Japan", "Jersey", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Kosovo", "Kuwait", "Kyrgyzstan", "Laos", "Latvia", "Lebanon", "Lesotho", "Liberia", "Libya", "Liechtenstein", "Lithuania", "Luxembourg", "Macau", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Man (Isle of)", "Marshall Islands", "Martinique", "Mauritania", "Mauritius", "Mayotte", "Mexico", "Micronesia", "Moldova", "Monaco", "Mongolia", "Montenegro", "Montserrat", "Morocco", "Mozambique", "Myanmar", "Namibia", "Nauru", "Nepal", "Netherlands", "New Caledonia", "New Zealand", "Nicaragua", "Niger", "Nigeria", "Niue", "Norfolk Island", "North Korea", "North Macedonia", "Northern Mariana Islands", "Norway", "Oman", "Pakistan", "Palau", "Palestinian Territory Occupied", "Panama", "Papua new Guinea", "Paraguay", "Peru", "Philippines", "Pitcairn Island", "Poland", "Portugal", "Puerto Rico", "Qatar", "Reunion", "Romania", "Russia", "Rwanda", "Saint Helena", "Saint Kitts And Nevis", "Saint Lucia", "Saint Pierre and Miquelon", "Saint Vincent And The Grenadines", "Saint-Barthelemy", "Saint-Martin (French part)", "Samoa", "San Marino", "Sao Tome and Principe", "Saudi Arabia", "Senegal", "Serbia", "Seychelles", "Sierra Leone", "Singapore", "Sint Maarten (Dutch part)", "Slovakia", "Slovenia", "Solomon Islands", "Somalia", "South Africa", "South Georgia", "South Korea", "South Sudan", "Spain", "Sri Lanka", "Sudan", "Suriname", "Svalbard And Jan Mayen Islands", "Swaziland", "Sweden", "Switzerland", "Syria", "Taiwan", "Tajikistan", "Tanzania", "Thailand", "The Bahamas", "Togo", "Tokelau", "Tonga", "Trinidad And Tobago", "Tunisia", "Türkiye", "Turkmenistan", "Turks And Caicos Islands", "Tuvalu", "Uganda", "Ukraine", "United Arab Emirates", "United Kingdom", "United States", "United States Minor Outlying Islands", "Uruguay", "Uzbekistan", "Vanuatu", "Vatican City State (Holy See)", "Venezuela", "Vietnam", "Virgin Islands (British)", "Virgin Islands (US)", "Wallis And Futuna Islands", "Western Sahara", "Yemen", "Zambia", "Zimbabwe"]; /** * Represents all possible countries & regions with their corresponding English * names. */ declare const EnglishCountryNames: Record; /** * Represents all possible countries & regions with their corresponding * Simplified Chinese names. */ declare const SimplifiedChineseCountryNames: Record; /** * Represents all possible countries & regions with their corresponding * Traditional Chinese HK names. */ declare const TraditionalChineseCountryHKNames: Record; /** * Represents all possible countries & regions with their corresponding * Traditional Chinese TW names. */ declare const TraditionalChineseCountryTWNames: Record; /** * Represents all possible countries & regions with their corresponding * Spanish names. */ declare const SpanishCountryNames: Record; /** * Represents all possible countries & regions with their corresponding * French names. */ declare const FrenchCountryNames: Record; declare const NorwegianCountryNames: Record; /** * Represents all possible countries & regions with their corresponding Dutch names. */ declare const DutchCountryNames: Record; /** * Represents all possible countries & regions with their corresponding Japanese names. */ declare const JapaneseCountryNames: Record; /** * Represents all possible countries & regions with their corresponding German names. */ declare const GermanCountryNames: Record; /** * Represents all possible countries & regions with their corresponding Indonesian names. */ declare const IndonesianCountryNames: Record; /** * Represents all possible countries & regions with their corresponding * Brazilian Portuguese names. */ declare const BrazilianPortugueseCountryNames: Record; /** * MIT License * * Copyright (c) 2023–Present PPResume (https://ppresume.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ /** * Defines all possible degrees. */ declare const DEGREE_OPTIONS: readonly ["Middle School", "High School", "Diploma", "Associate", "Bachelor", "Master", "Doctor"]; /** The options for the DOCX layout font size (in half-points, displayed as pt). */ declare const DOCX_FONT_SIZE_OPTIONS: readonly ["10pt", "10.5pt", "11pt", "11.5pt", "12pt"]; /** The options for the docx layout paper size. */ declare const DOCX_PAPER_SIZE_OPTIONS: readonly ["a4", "letter"]; /** Defines identifiers for the available DOCX layout templates. */ declare const DOCX_TEMPLATE_OPTIONS: readonly ["calm"]; /** * Defines language fluency levels. * * Based on the Interagency Language Roundtable (ILR) scale. */ declare const FLUENCY_OPTIONS: readonly ["Elementary Proficiency", "Limited Working Proficiency", "Minimum Professional Proficiency", "Full Professional Proficiency", "Native or Bilingual Proficiency"]; /** Defines identifiers for the available HTML layout templates. */ declare const HTML_TEMPLATE_OPTIONS: readonly ["calm", "vscode"]; /** The options for the HTML layout font size. */ declare const HTML_FONT_SIZE_OPTIONS: readonly ["14px", "15px", "16px", "17px", "18px", "19px", "20px"]; /** The options for the latex layout font size. */ declare const LATEX_FONT_SIZE_OPTIONS: readonly ["10pt", "11pt", "12pt"]; /** The options for the latex layout fontspec numbers style. */ declare const LATEX_FONTSPEC_NUMBERS_OPTIONS: readonly ["Lining", "OldStyle", "Auto"]; /** The options for the paper size. */ declare const LATEX_PAPER_SIZE_OPTIONS: readonly ["a4", "letter"]; /** Defines identifiers for the available latex layout templates. */ declare const LATEX_TEMPLATE_OPTIONS: readonly ["jake", "moderncv-banking", "moderncv-casual", "moderncv-classic"]; /** * Defines common world languages. * * This list contains the most used languages in the world. * * TODO: allow users to add their own languages */ declare const LANGUAGE_OPTIONS: readonly ["Afrikaans", "Albanian", "Amharic", "Arabic", "Azerbaijani", "Belarusian", "Bengali", "Bhojpuri", "Bulgarian", "Burmese", "Cantonese", "Catalan", "Chinese", "Croatian", "Czech", "Danish", "Dutch", "English", "Estonian", "Farsi", "Filipino", "Finnish", "French", "German", "Greek", "Gujarati", "Hausa", "Hebrew", "Hindi", "Hungarian", "Icelandic", "Igbo", "Indonesian", "Irish", "Italian", "Japanese", "Javanese", "Kazakh", "Khmer", "Korean", "Lahnda", "Latvian", "Lithuanian", "Malay", "Mandarin", "Marathi", "Nepali", "Norwegian", "Oromo", "Pashto", "Polish", "Portuguese", "Romanian", "Russian", "Serbian", "Shona", "Sinhala", "Slovak", "Slovene", "Somali", "Spanish", "Sundanese", "Swahili", "Swedish", "Tagalog", "Tamil", "Telugu", "Thai", "Turkish", "Ukrainian", "Urdu", "Uzbek", "Vietnamese", "Yoruba", "Zulu"]; /** * Defines skill proficiency levels. * * Based on common industry standards for skill assessment. */ declare const LEVEL_OPTIONS: readonly ["Novice", "Beginner", "Intermediate", "Advanced", "Expert", "Master"]; /** * Defines line spacing options (shared across all engines). * * These semantic values follow Tailwind CSS's leading scale exactly: * - tight: Compact spacing for fitting more content * - snug: Slightly more space than tight * - normal: Balanced readability (default) * - relaxed: Comfortable reading with more breathing room * - loose: Very spacious layout (generally not recommended) * * @see {@link https://tailwindcss.com/docs/line-height} */ declare const LINE_SPACING_OPTIONS: readonly ["tight", "snug", "normal", "relaxed", "loose"]; /** * Defines supported languages for UI display and template translation. * * @see {@link https://en.wikipedia.org/wiki/IETF_language_tag} */ declare const LOCALE_LANGUAGE_OPTIONS: readonly ["en", "zh-hans", "zh-hant-hk", "zh-hant-tw", "es", "fr", "no", "nl", "ja", "de", "id", "pt-br"]; /** * Defines network options. */ declare const NETWORK_OPTIONS: readonly ["Behance", "Dribbble", "Facebook", "GitHub", "Gitlab", "Instagram", "Line", "LinkedIn", "Medium", "Pinterest", "Reddit", "Snapchat", "Stack Overflow", "Telegram", "TikTok", "Twitch", "Twitter", "Vimeo", "Weibo", "WeChat", "WhatsApp", "YouTube", "Zhihu"]; /** * MIT License * * Copyright (c) 2023–Present PPResume (https://ppresume.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ /** * A union type for all possible countries and regions in the world. */ type Country = (typeof COUNTRY_OPTIONS)[number]; /** * A union type for all possible degrees. */ type Degree = (typeof DEGREE_OPTIONS)[number]; /** * A union type for all possible docx paper size options. */ type DocxPaperSize = (typeof DOCX_PAPER_SIZE_OPTIONS)[number]; /** * A union type for all possible DOCX template options. * * @see {@link https://yamlresume.dev/docs/layouts/docx/templates} */ type DocxTemplate = (typeof DOCX_TEMPLATE_OPTIONS)[number]; /** * A union type for all possible docx layout font size options. */ type DocxFontSize = (typeof DOCX_FONT_SIZE_OPTIONS)[number]; /** * A union type for all possible language fluency levels. */ type Fluency = (typeof FLUENCY_OPTIONS)[number]; /** * A union type for all possible HTML font size options. */ type HtmlFontSize = (typeof HTML_FONT_SIZE_OPTIONS)[number]; /** * A union type for all possible HTML template options. * * @see {@link https://yamlresume.dev/docs/layouts/html/templates} */ type HtmlTemplate = (typeof HTML_TEMPLATE_OPTIONS)[number]; /** * Keywords type, just an alias for a string list. */ type Keywords = string[]; /** * A union type for all supported languages. */ type Language = (typeof LANGUAGE_OPTIONS)[number]; /** * A union type for all possible latex fontspec numbers options. * * - `Auto` - allowing the style to be automatically determined * based on the selected `LocaleLanguage` (default) * - `Lining` - standard lining figures (default for CJK languages) * - `OldStyle` - old style figures with varying heights (default for Latin * languages) */ type LatexFontspecNumbers = (typeof LATEX_FONTSPEC_NUMBERS_OPTIONS)[number]; /** * A union type for all possible latex font size options. * * For now only 3 options are supported: * * - `10pt` - 10pt font size (default) * - `11pt` - 11pt font size * - `12pt` - 12pt font size */ type LatexFontSize = (typeof LATEX_FONT_SIZE_OPTIONS)[number]; /** * A union type for all possible template options. * * @see {@link https://yamlresume.dev/docs/layouts/latex/templates} */ type LatexTemplate = (typeof LATEX_TEMPLATE_OPTIONS)[number]; /** * A union type for all possible skill proficiency levels. */ type Level = (typeof LEVEL_OPTIONS)[number]; /** * A union type for all possible latex paper size options. */ type LatexPaperSize = (typeof LATEX_PAPER_SIZE_OPTIONS)[number]; /** * A union type for all possible line spacing options. */ type LineSpacing = (typeof LINE_SPACING_OPTIONS)[number]; /** * A union type for all possible locale languages. * * @see {@link https://yamlresume.dev/docs/locale} */ type LocaleLanguage = (typeof LOCALE_LANGUAGE_OPTIONS)[number]; /** * A union type for all possible social network options. */ type Network = (typeof NETWORK_OPTIONS)[number]; /** * MIT License * * Copyright (c) 2023–Present PPResume (https://ppresume.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ /** * Represents a single award, honor, or recognition received. * * @see {@link awardItemSchema} for its schema constraints. */ type AwardItem = { /** The organization or entity that gave the award. */ awarder: string; /** The name or title of the award. */ title: string; /** The date the award was received (e.g., "2020", "Oct 2020"). */ date?: string; /** A short description or details about the award. */ summary?: string; /** Computed values derived during transformation. */ computed?: { /** Transformed date string. */ date: string; /** Transformed summary string (e.g., LaTeX code). */ summary: string; }; }; /** * Contains a collection of awards and recognitions. * * @see {@link awardsSchema} for its schema constraints. */ type Awards = { /** A list of awards. */ awards?: AwardItem[]; }; /** * Represents the core personal and contact information. * * @see {@link basicsItemSchema} for its schema constraints. */ type BasicsItem = { /** Full name. */ name: string; /** Email address. */ email?: string; /** A brief professional headline or title (e.g., "Software Engineer"). */ headline?: string; /** Phone number. */ phone?: string; /** A professional summary or objective statement. */ summary?: string; /** Personal website or portfolio URL. */ url?: string; /** Computed values derived during transformation. */ computed?: { /** Transformed summary string (e.g., LaTeX code). */ summary: string; /** Transformed URL string (e.g., LaTeX href command). */ url: string; }; }; /** * Contains the core personal and contact information. * * @see {@link basicsSchema} for its schema constraints. */ type Basics = { /** The basic personal information item. */ basics: BasicsItem; }; /** * Represents a single certification, credential, or professional qualification. * * @see {@link certificateItemSchema} for its schema constraints. */ type CertificateItem = { /** The organization that issued the certificate. */ issuer: string; /** The name of the certificate. */ name: string; /** The date the certificate was obtained (e.g., "2021", "Nov 2021"). */ date?: string; /** URL related to the certificate (e.g., verification link). */ url?: string; /** Computed values derived during transformation. */ computed?: { /** Transformed date string. */ date: string; }; }; /** * Contains a collection of certifications and credentials. * * @see {@link certificatesSchema} for its schema constraints. */ type Certificates = { /** A list of certificates. */ certificates?: CertificateItem[]; }; /** * Represents a single educational experience or degree program. * * @see {@link educationItemSchema} for its schema constraints. */ type EducationItem = { /** Area of study (e.g., "Computer Science"). */ area: string; /** The type of degree obtained. */ degree: Degree; /** Name of the institution. */ institution: string; /** Start date of study (e.g., "2016", "Sep 2016"). */ startDate: string; /** List of courses taken. */ courses?: string[]; /** End date of study (e.g., "2020", "May 2020"), empty implies "Present". */ endDate?: string; /** Description of accomplishments or details. */ summary?: string; /** GPA or academic score. */ score?: string; /** URL related to the institution or degree. */ url?: string; /** Computed values derived during transformation. */ computed?: { /** Transformed courses string (e.g., comma-separated). */ courses: string; /** Combined string of degree, area, and score. */ degreeAreaAndScore: string; /** Combined string representing the date range. */ dateRange: string; /** Transformed start date string. */ startDate: string; /** Transformed end date string (or "Present"). */ endDate: string; /** Transformed summary string (e.g., LaTeX code). */ summary: string; }; }; /** * Contains a collection of educational experiences. * * @see {@link educationSchema} for its schema constraints. */ type Education = { /** A list of education experiences. */ education: EducationItem[]; }; /** * Represents a single interest, hobby, or personal activity. * * @see {@link interestItemSchema} for its schema constraints. */ type InterestItem = { /** Name of the interest category (e.g., "Reading", "Photography"). */ name: string; /** Keywords related to the interest. */ keywords?: Keywords; /** Computed values derived during transformation. */ computed?: { /** Transformed keywords string (e.g., comma-separated). */ keywords: string; }; }; /** * Contains a collection of personal interests and hobbies. * * @see {@link interestsSchema} for its schema constraints. */ type Interests = { /** A list of interests. */ interests?: InterestItem[]; }; /** * Represents a single language proficiency or skill level. * * @see {@link languageItemSchema} for its schema constraints. */ type LanguageItem = { /** The level of proficiency of the language. */ fluency: Fluency; /** The language. */ language: Language; /** Specific keywords related to language skills (e.g., "Translation"). */ keywords?: Keywords; /** Computed values derived during transformation. */ computed?: { /** Translated fluency level string. */ fluency: string; /** Translated language name string. */ language: string; /** Transformed keywords string. */ keywords: string; }; }; /** * Contains a collection of language proficiencies. * * @see {@link languagesSchema} for its schema constraints. */ type Languages = { /** A list of languages. */ languages?: LanguageItem[]; }; /** * Represents location and address information. * * @see {@link locationItemSchema} for its schema constraints. */ type LocationItem = { /** City name. */ city: string; /** Street address. */ address?: string; /** Country code or name. */ country?: Country; /** Postal or ZIP code. */ postalCode?: string; /** State, province, or region. */ region?: string; /** Computed values derived during transformation. */ computed?: { /** Fully formatted address string based on locale. */ fullAddress: string; }; }; /** * Contains location and address information. * * @see {@link locationSchema} for its schema constraints. */ type Location = { /** The location information item. */ location?: LocationItem; }; /** * Represents a single online profile or social media presence. * * @see {@link profileItemSchema} for its schema constraints. */ type ProfileItem = { /** The name of the network or platform. */ network: Network; /** The username on the platform. */ username: string; /** The URL of the profile. */ url?: string; /** Computed values derived during transformation. */ computed?: { /** Transformed URL string (e.g., LaTeX href with icon). */ url: string; }; }; /** * Contains a collection of online profiles and social media presence. * * @see {@link profilesSchema} for its schema constraints. */ type Profiles = { /** A list of online profiles. */ profiles?: ProfileItem[]; }; /** * Represents a single project, portfolio piece, or technical work. * * @see {@link projectItemSchema} for its schema constraints. */ type ProjectItem = { /** Name of the project. */ name: string; /** Start date of the project (e.g., "2021", "Jan 2021"). */ startDate: string; /** Detailed accomplishments for the project. */ summary: string; /** Description of the project. */ description?: string; /** End date of the project (e.g., "2022", "Jul 2022"). */ endDate?: string; /** Keywords or technologies used in the project. */ keywords?: Keywords; /** URL related to the project (e.g., repository, live demo). */ url?: string; /** Computed values derived during transformation. */ computed?: { /** Combined string representing the date range. */ dateRange: string; /** Transformed keywords string. */ keywords: string; /** Transformed start date string. */ startDate: string; /** Transformed end date string (or "Present"). */ endDate: string; /** Transformed summary string (e.g., LaTeX code). */ summary: string; }; }; /** * Contains a collection of projects and portfolio pieces. * * @see {@link projectsSchema} for its schema constraints. */ type Projects = { /** A list of projects. */ projects?: ProjectItem[]; }; /** * Represents a single publication, research work, or academic paper. * * @see {@link publicationItemSchema} for its schema constraints. */ type PublicationItem = { /** Name or title of the publication. */ name: string; /** Publisher of the work. */ publisher: string; /** Date of publication (e.g., "2023", "Mar 2023"). */ releaseDate?: string; /** Summary or abstract of the publication. */ summary?: string; /** URL related to the publication (e.g., DOI, link). */ url?: string; /** Computed values derived during transformation. */ computed?: { /** Transformed release date string. */ releaseDate: string; /** Transformed summary string (e.g., LaTeX code). */ summary: string; }; }; /** * Contains a collection of publications and research works. * * @see {@link publicationsSchema} for its schema constraints. */ type Publications = { /** A list of publications. */ publications?: PublicationItem[]; }; /** * Represents a single professional reference or recommendation. * * @see {@link referenceItemSchema} for its schema constraints. */ type ReferenceItem = { /** Name of the reference. */ name: string; /** A brief note about the reference. */ summary: string; /** Email address of the reference. */ email?: string; /** Phone number of the reference. */ phone?: string; /** Relationship to the reference (e.g., "Former Manager"). */ relationship?: string; /** Computed values derived during transformation. */ computed?: { /** Transformed summary string (e.g., LaTeX code). */ summary: string; }; }; /** * Contains a collection of professional references and recommendations. * * @see {@link referencesSchema} for its schema constraints. */ type References = { /** A list of references. */ references?: ReferenceItem[]; }; /** * Represents a single skill, competency, or technical ability. * * @see {@link skillItemSchema} for its schema constraints. */ type SkillItem = { /** Proficiency level in the skill. */ level: Level; /** Name of the skill. */ name: string; /** Specific keywords or technologies related to the skill. */ keywords?: Keywords; /** Computed values derived during transformation. */ computed?: { /** Translated level string. */ level: string; /** Transformed keywords string. */ keywords: string; }; }; /** * Contains a collection of skills and competencies. * * @see {@link skillsSchema} for its schema constraints. */ type Skills = { /** A list of skills. */ skills?: SkillItem[]; }; /** * Represents a single volunteer experience or community service. * * @see {@link volunteerItemSchema} for its schema constraints. */ type VolunteerItem = { /** Name of the organization. */ organization: string; /** Role or position held. */ position: string; /** Start date of the volunteer work (e.g., "2019", "Jun 2019"). */ startDate: string; /** Summary of responsibilities or achievements. */ summary: string; /** End date of the volunteer work (e.g., "2020", "Dec 2020"). */ endDate?: string; /** URL related to the organization or work. */ url?: string; /** Computed values derived during transformation. */ computed?: { /** Combined string representing the date range. */ dateRange: string; /** Transformed start date string. */ startDate: string; /** Transformed end date string (or "Present"). */ endDate: string; /** Transformed summary string (e.g., LaTeX code). */ summary: string; }; }; /** * Contains a collection of volunteer experiences and community service. * * @see {@link volunteerSchema} for its schema constraints. */ type Volunteer = { /** A list of volunteer experiences. */ volunteer?: VolunteerItem[]; }; /** * Represents a single work experience or employment position. * * @see {@link workItemSchema} for its schema constraints. */ type WorkItem = { /** Name of the company or employer. */ name: string; /** Job title or position held. */ position: string; /** Start date of employment (e.g., "2021", "Apr 2021"). */ startDate: string; /** Summary of responsibilities and accomplishments. */ summary: string; /** End date of employment (e.g., "2023", "Aug 2023"). */ endDate?: string; /** Keywords related to the role or technologies used. */ keywords?: Keywords; /** URL related to the company or work. */ url?: string; /** Computed values derived during transformation. */ computed?: { /** Transformed keywords string. */ keywords: string; /** Combined string representing the date range. */ dateRange: string; /** Transformed start date string. */ startDate: string; /** Transformed end date string (or "Present"). */ endDate: string; /** Transformed summary string (e.g., LaTeX code). */ summary: string; }; }; /** * Contains a collection of work experiences and employment history. * * @see {@link workSchema} for its schema constraints. */ type Work = { /** A list of work experiences. */ work?: WorkItem[]; }; /** * Defines a collection of all possible "items" in a resume. */ type ResumeItem = { award: AwardItem; basics: BasicsItem; certificate: CertificateItem; education: EducationItem; interest: InterestItem; language: LanguageItem; location: LocationItem; project: ProjectItem; profile: ProfileItem; publication: PublicationItem; reference: ReferenceItem; skill: SkillItem; volunteer: VolunteerItem; work: WorkItem; }; /** * Defines the structure for the entire resume content. * * - only `basics` and `education` sections are mandatory. */ type Content = { /** Represents the core personal and contact information. */ basics: BasicsItem; /** Contains a collection of educational experiences. */ education: EducationItem[]; /** Contains a collection of awards and recognitions. */ awards?: AwardItem[]; /** Contains a collection of certifications and credentials. */ certificates?: CertificateItem[]; /** Contains a collection of interests, hobbies, or personal activities. */ interests?: InterestItem[]; /** Contains a collection of language proficiencies. */ languages?: LanguageItem[]; /** Contains location information. */ location?: LocationItem; /** Contains a collection of projects. */ projects?: ProjectItem[]; /** Contains a collection of online profiles. */ profiles?: ProfileItem[]; /** Contains a collection of publications. */ publications?: PublicationItem[]; /** Contains a collection of references. */ references?: ReferenceItem[]; /** Contains a collection of skills. */ skills?: SkillItem[]; /** Contains a collection of volunteer experiences. */ volunteer?: VolunteerItem[]; /** Contains a collection of work experiences and employment history. */ work?: WorkItem[]; /** * Computed values derived during transformation, applicable to the entire * content. */ computed?: { /** Translated names for each resume section based on locale. */ sectionNames?: { awards?: string; basics?: string; certificates?: string; education?: string; interests?: string; languages?: string; location?: string; projects?: string; profiles?: string; publications?: string; references?: string; skills?: string; volunteer?: string; work?: string; }; }; }; /** * MIT License * * Copyright (c) 2023–Present PPResume (https://ppresume.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ /** * Defines locale settings for internationalization and localization. */ type Locale = { /** The selected language for the resume content and template terms. */ language?: LocaleLanguage; }; /** * MIT License * * Copyright (c) 2023–Present PPResume (https://ppresume.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ /** * A union type for all possible section IDs that can be aliased and re-ordered. */ type OrderableSectionID = (typeof ORDERABLE_SECTION_IDS)[number]; /** * A union type for all possible section IDs. */ type SectionID = (typeof SECTION_IDS)[number]; /** * Defines the overall resume structure, including content and layout. * * - `content` is mandatory. * - `layouts` is optional, yamlresume provide a default list of layouts if * absent. */ type Resume = { /** Defines the structure for the entire resume content. */ content: Content; /** Top-level locale setting. */ locale?: Locale; /** Multiple output layout configurations. */ layouts?: Layouts; }; /** * MIT License * * Copyright (c) 2023–Present PPResume (https://ppresume.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ /** * Defines page margin settings for document layout. */ type Margins = { /** Top margin value (e.g., "2.5cm"). */ top?: string; /** Bottom margin value (e.g., "2.5cm"). */ bottom?: string; /** Left margin value (e.g., "1.5cm"). */ left?: string; /** Right margin value (e.g., "1.5cm"). */ right?: string; }; /** * A union type for all possible layout engines. */ type LayoutEngine = 'docx' | 'html' | 'latex' | 'markdown'; /** * Defines section alias settings for customizing section names. */ type Sections = { /** Custom aliases for section names, overriding default translations. */ aliases?: Partial>; /** Custom order for sections in the final output. */ order?: OrderableSectionID[]; }; /** * MIT License * * Copyright (c) 2023–Present PPResume (https://ppresume.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ /** * Typography settings for DOCX layout. */ type DocxTypography = { /** Font size option (e.g., '10pt', '11pt', '12pt'). */ fontSize?: DocxFontSize; /** Font family name (e.g., 'Arial', 'Times New Roman'). */ fontFamily?: string; /** Line spacing option. */ lineSpacing?: LineSpacing; }; /** * Defines advanced DOCX configuration options. */ type DocxAdvanced = { /** Whether to show raw URLs or hide them behind reasonable text. */ showUrls?: boolean; /** * Whether to show icons for links and profiles. * * NOTE: WPS Office has poor emoji font fallback and may render icons as * squares or partial glyphs; Microsoft Office should be able to handle these * emojis correctly via Segoe UI Emoji (Windows) or Apple Color Emoji * (macOS)—I havn't test Microsoft office because I do not have a copy; * macOS pages can show these emojis and so do LibreOffice with my test on * macOS 14. */ showIcons?: boolean; }; /** * Defines DOCX page-level settings for document presentation. */ type DocxPage = { /** Whether to display page numbers. */ showPageNumbers?: boolean; /** Defines page margin settings for document layout. */ margins?: Margins; /** Defines the paper size for the document. */ paperSize?: DocxPaperSize; }; /** * DOCX layout configuration. */ type DocxLayout = { engine: 'docx'; /** Defines page-level settings for document presentation. */ page?: DocxPage; /** The template to use for DOCX output. */ template?: DocxTemplate; /** Defines section customization settings. */ sections?: Sections; /** Typography settings for DOCX output. */ typography?: DocxTypography; /** Defines advanced configuration options. */ advanced?: DocxAdvanced; }; /** * MIT License * * Copyright (c) 2023–Present PPResume (https://ppresume.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ /** * Defines HTML typography settings for document formatting. */ type HtmlTypography = { /** Base font size for the document (e.g., "small", "medium", "large"). */ fontSize?: HtmlFontSize; /** A comma-separated list of font families to use. */ fontFamily?: string; /** Line spacing for the document (e.g., "tight", "normal", "relaxed"). */ lineSpacing?: LineSpacing; }; /** * Defines advanced HTML configuration options. */ type HtmlAdvanced = { /** Whether to show icons for links and profiles. */ showIcons?: boolean; /** Custom title for the HTML document. */ title?: string; /** Custom footer for the HTML document. */ footer?: string; /** Meta description for the HTML document. */ description?: string; /** Meta keywords for the HTML document. */ keywords?: string; }; /** * HTML layout configuration. * * Defines the structure for HTML-specific layout settings including * template selection, typography options, and section configuration. */ type HtmlLayout = { engine: 'html'; /** Defines the selected template. */ template?: HtmlTemplate; /** Defines typography settings for document formatting. */ typography?: HtmlTypography; /** Defines section customization settings. */ sections?: Sections; /** Defines advanced configuration options. */ advanced?: HtmlAdvanced; }; /** * MIT License * * Copyright (c) 2023–Present PPResume (https://ppresume.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ /** * Defines latex link styling settings for typography. */ type Links = { /** Whether to underline links in the document. */ underline?: boolean; }; /** * Defines latex typography settings for document formatting. */ type LatexTypography = { /** Base font size for the document (e.g., "10pt", "11pt"). */ fontSize?: LatexFontSize; /** A comma-separated list of font families to use. */ fontFamily?: string; /** Line spacing for the document (e.g., "tight", "normal", "relaxed"). */ lineSpacing?: LineSpacing; /** Link styling settings. */ links?: Links; }; /** * Defines advanced latex configuration options. */ type LatexAdvanced = { /** LaTeX fontspec package configurations. */ fontspec?: { /** Style for rendering numbers (Lining or OldStyle). */ numbers?: LatexFontspecNumbers; }; /** Whether to show icons for links and profiles. */ showIcons?: boolean; /** Whether to show raw URLs or hide them behind reasonable text. */ showUrls?: boolean; }; /** * Defines latex page-level settings for document presentation. */ type LatexPage = { /** Whether to display page numbers. */ showPageNumbers?: boolean; /** Defines page margin settings for document layout. */ margins?: Margins; /** * Defines the paper size for the document. */ paperSize?: LatexPaperSize; }; /** * LaTeX layout configuration. */ type LatexLayout = { engine: 'latex'; /** Defines page-level settings for document presentation. */ page?: LatexPage; /** Defines section customization settings. */ sections?: Sections; /** Defines the selected template. */ template?: LatexTemplate; /** Defines typography settings for document formatting. */ typography?: LatexTypography; /** Defines advanced configuration options. */ advanced?: LatexAdvanced; }; /** * MIT License * * Copyright (c) 2023–Present PPResume (https://ppresume.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ /** * Markdown layout configuration. * * Keep it minimal for now; can be extended later. */ type MarkdownLayout = { engine: 'markdown'; /** Defines section customization settings. */ sections?: Sections; }; /** * MIT License * * Copyright (c) 2023–Present PPResume (https://ppresume.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ /** * Array of layout items supporting multiple output formats. */ type Layout = DocxLayout | HtmlLayout | LatexLayout | MarkdownLayout; type Layouts = Layout[]; /** * MIT License * * Copyright (c) 2023–Present PPResume (https://ppresume.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ /** * All valid top-level sections in the resume. */ declare const SECTION_IDS: readonly ["basics", "location", "profiles", "education", "work", "volunteer", "awards", "certificates", "publications", "skills", "languages", "interests", "references", "projects"]; /** * All valid top-level sections in the resume that can be re-ordered. * * `location` and `profiles` are excluded as these are not real sections, i.e, * they are always rendered as part of the "core" information at the start of a * resume, not rendered as normal sections */ declare const ORDERABLE_SECTION_IDS: readonly ["basics", "education", "work", "volunteer", "awards", "certificates", "publications", "skills", "languages", "interests", "references", "projects"]; /** * Default order for sections in the resume output. * * Sections not specified in custom order will follow this order. */ declare const DEFAULT_SECTIONS_ORDER: OrderableSectionID[]; /** * Get the detail of the given LaTeX template. * * @param template - The template to get the detail for. * @returns The detail of the template. */ declare function getLatexTemplateDetail(template: LatexTemplate): { engine: LayoutEngine; name: string; description: string; id: "jake" | "moderncv-banking" | "moderncv-casual" | "moderncv-classic"; }; /** * Get the detail of the given HTML template. * * @param template - The template to get the detail for. * @returns The detail of the template. */ declare function getHtmlTemplateDetail(template: HtmlTemplate): { engine: LayoutEngine; name: string; description: string; id: "calm" | "vscode"; }; /** * Get the detail of the given DOCX template. * * @param template - The template to get the detail for. * @returns The detail of the template. */ declare function getDocxTemplateDetail(template: DocxTemplate): { engine: LayoutEngine; name: string; description: string; id: "calm"; }; /** Provides default, empty item structures for each resume section type. */ declare const RESUME_SECTION_ITEMS: ResumeItem; /** * Default content structure for a new resume, containing empty or minimal * sections. */ declare const DEFAULT_RESUME_CONTENT: Content; /** * Resume content structure containing one example item for each section. * * Useful for testing transformations and rendering. */ declare const FILLED_RESUME_CONTENT: Content; /** Available margin size options for resume layout. */ declare const MARGIN_OPTIONS: string[]; /** * Get the language code and name of the given locale language. * * @param localeLanguage The locale language to get the name for. * @returns The language code and name of the given locale language. */ declare function getLocaleLanguageDetail(localeLanguage: LocaleLanguage): { localeLanguage: "en" | "zh-hans" | "zh-hant-hk" | "zh-hant-tw" | "es" | "fr" | "no" | "nl" | "ja" | "de" | "id" | "pt-br"; name: string; }; /** Default DOCX layout configuration. */ declare const DEFAULT_DOCX_LAYOUT: DocxLayout; /** Default HTML layout configuration. */ declare const DEFAULT_HTML_LAYOUT: HtmlLayout; /** Default Markdown layout configuration. */ declare const DEFAULT_MARKDOWN_LAYOUT: MarkdownLayout; /** Default LaTeX layout configuration for the new layouts array. */ declare const DEFAULT_LATEX_LAYOUT: LatexLayout; /** * Default layouts configuration. * * We only include LaTeX, Markdown, and HTML layouts by default, which should be * good enough for most people. */ declare const DEFAULT_RESUME_LAYOUTS: Layouts; /** Default locale configuration. */ declare const DEFAULT_RESUME_LOCALE: Locale; /** Default value when user creates a new `Resume` object. */ declare const DEFAULT_RESUME: Resume; /** * Default value when user wants to use a filled resume. * * This is useful for testing transformations and rendering. */ declare const FILLED_RESUME: Resume; /** * MIT License * * Copyright (c) 2023–Present PPResume (https://ppresume.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ /** * Context for code generation containing layout settings. */ interface CodeGenerationContext { /** Typography settings from the resume layout. */ typography?: LatexLayout['typography'] | HtmlLayout['typography'] | DocxLayout['typography']; } /** * Interface to generate code from an AST. * * This interface defines the contract for code generation of abstract syntax * tree (AST) nodes. Implementations of this interface are responsible for * converting AST nodes into their corresponding code representations. * * HTMLCodeGenerator and LatexCodeGenerator will generate strings while * DocxCodeGenerator will generate docx Paragraph objects, hence the generic * type parameter T. * * @see {@link Node} */ interface CodeGenerator { /** * Generate code from an AST node. * * @param node - The AST node to generate code from. * @param context - Optional context containing layout settings. * @returns The generated code. */ generate(node: Node, context?: CodeGenerationContext): T; } /** * MIT License * * Copyright (c) 2023–Present PPResume (https://ppresume.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ /** * Generate DOCX paragraphs from an AST node. * * This class implements the `CodeGenerator` interface and provides a method * to convert an AST node into its corresponding DOCX paragraph elements. * * @see {@link CodeGenerator} */ declare class DocxCodeGenerator implements CodeGenerator { /** * Generate DOCX paragraphs from an AST node. * * @param node - The AST node to generate DOCX paragraphs from. * @param context - Optional context containing layout settings. * @returns {Paragraph[]} The generated DOCX paragraphs. */ generate(node: Node, context?: CodeGenerationContext): Paragraph[]; } /** * MIT License * * Copyright (c) 2023–Present PPResume (https://ppresume.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ /** * Generate HTML code from a Node. * * This class implements the `CodeGenerator` interface and provides a method * to convert an AST node into its corresponding HTML code. * * @see {@link CodeGenerator} */ declare class HtmlCodeGenerator implements CodeGenerator { /** * Generate HTML code from an AST node. * * @param node - The AST node to generate HTML code from. * @param context - Optional context containing layout settings. * @returns The generated HTML code. */ generate(node: Node, context?: CodeGenerationContext): string; } /** * MIT License * * Copyright (c) 2023–Present PPResume (https://ppresume.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ /** * Generate LaTeX code from a Node. * * This class implements the `CodeGenerator` interface and provides a method * to convert an AST node into its corresponding LaTeX code. * * @see {@link CodeGenerator} */ declare class LatexCodeGenerator implements CodeGenerator { /** * Generate LaTeX code from an AST node. * * @param node - The AST node to generate LaTeX code from. * @param context - Optional context containing layout settings. * @returns The generated LaTeX code. */ generate(node: Node, context?: CodeGenerationContext): string; } /** * MIT License * * Copyright (c) 2023–Present PPResume (https://ppresume.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ /** * Interface for parsing input strings into AST nodes. * * Implementations of this interface are responsible for converting input * strings into their corresponding abstract syntax tree (AST) representations. * * @see {@link Node} */ interface Parser { /** * Parse an input string into an AST node. * * @param input - The input string to parse. * @returns The parsed AST node. */ parse(input: string): Node; } /** * MIT License * * Copyright (c) 2023–Present PPResume (https://ppresume.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ /** * Parse markdown to ast node * * Under the hood this class first parse the markdown to mdast and then * transform the mdast to ast node. * * @see {@link Parser} */ declare class MarkdownParser implements Parser { /** * Parse markdown to ast node * * @param input - The markdown input to parse * @returns The ast node */ parse(input: string): Node; } /** * Enum of error codes for YAMLResumeError. * * Error codes are used to identify specific errors and can be used to * internationalize error messages. */ declare const ErrorType: { readonly FILE_NOT_FOUND: { readonly code: "FILE_NOT_FOUND"; readonly errno: number; readonly message: "Resume not found: {path}"; readonly path: ""; }; readonly FILE_READ_ERROR: { readonly code: "FILE_READ_ERROR"; readonly errno: number; readonly message: "Failed to read resume file: {path}"; readonly path: ""; }; readonly FILE_WRITE_ERROR: { readonly code: "FILE_WRITE_ERROR"; readonly errno: number; readonly message: "Failed to write file: {path}"; readonly path: ""; }; readonly FILE_CONFLICT: { readonly code: "FILE_CONFLICT"; readonly errno: number; readonly message: string; readonly path: ""; }; readonly INVALID_EXTNAME: { readonly code: "INVALID_EXTNAME"; readonly errno: number; readonly message: string; readonly extname: ""; }; readonly INVALID_YAML: { readonly code: "INVALID_YAML"; readonly errno: number; readonly message: "Invalid YAML format: {error}"; readonly error: ""; }; readonly INVALID_JSON: { readonly code: "INVALID_JSON"; readonly errno: number; readonly message: "Invalid JSON format: {error}"; readonly error: ""; }; readonly LATEX_NOT_FOUND: { readonly code: "LATEX_NOT_FOUND"; readonly errno: number; readonly message: "LaTeX compiler not found. Please install either xelatex or tectonic"; }; readonly LATEX_COMPILE_ERROR: { readonly code: "LATEX_COMPILE_ERROR"; readonly errno: number; readonly message: "LaTeX compilation failed: {error}"; readonly error: ""; }; readonly LATEX_COMPILE_TIMEOUT: { readonly code: "LATEX_COMPILE_TIMEOUT"; readonly errno: number; readonly message: string; readonly timeout: ""; }; }; /** * Type for the error code. */ type ErrorCodeType = keyof typeof ErrorType; /** * Type for the error message parameters. */ type ErrorMessageParams = { [K in ErrorCodeType]: { [P in keyof (typeof ErrorType)[K] as P extends 'message' | 'code' | 'errno' ? never : P]: string; }; }; /** * Custom error class for YAMLResume errors. */ declare class YAMLResumeError extends Error { code: T; errno: number; /** * Constructor for YAMLResumeError. * * @param code - The error code. * @param params - The error message parameters. */ constructor(code: T, params: ErrorMessageParams[T]); } /** * MIT License * * Copyright (c) 2023–Present PPResume (https://ppresume.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ /** * Applies all necessary transformations to a resume object in preparation for * rendering. * * This includes content processing, layout merging/adjustments, and environment * setup. * * The order of transformations is: content, layout, environment. * * @param resume - The original resume object. * @param layoutIndex - The index of the selected layout. * @param summaryParser - The parser instance for handling summary fields. * @param escapeFunc - The function to escape string values, i.e, `escapeLatex` * or `escapeHtml` * @returns A new, transformed resume object ready for rendering. * @remarks This function operates on and returns a deep clone of the original * resume. */ declare function transformResume(resume: Resume, layoutIndex: number, summaryParser: Parser, escapeFunc: (input: string) => string): Resume; /** * MIT License * * Copyright (c) 2023–Present PPResume (https://ppresume.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ /** * Abstract class for rendering resumes to various format. * * The renderer will render the resume to different formats such as HTML, * Markdown, and LaTeX based on the selected layout. * * You should not use this class directly, instead, use the `getResumeRenderer` * function to get the appropriate renderer for the given resume layout. * * By default, the renderer will render the resume in the following order: * * 1. Core information (basics, location, profiles) * 2. Education and career (education, work) * 3. Languages and skills * 4. Paper works (awards, certificates, publications) * 5. Persons and projects (references, projects) * 6. Non-essential information (interests, volunteer) */ declare abstract class Renderer { resume: Resume; layoutIndex: number; /** * Constructor for the Renderer class. * * @param resume - The resume to render. * @param layoutIndex - The index of the selected layout. */ constructor(resume: Resume, layoutIndex: number); /** * Render the preamble of the TeX document. * * @returns {string} The preamble of the TeX document. */ abstract renderPreamble(): T; /** * Render the basics section of the resume. * * @returns {string} The rendered basics section */ abstract renderBasics(): T; /** * Render the summary section of the resume. * * This method handles rendering the summary text stored in * resume.content.basics.summary. The summary is rendered separately from * other basic information since it may need to appear in a different location * in the output document depending on the template. * * @returns {string} The rendered summary section */ abstract renderSummary(): T; /** * Render the location section of the resume. * * @returns {string} The rendered location section */ abstract renderLocation(): T; /** * Render the profiles section of the resume. * * @returns {string} The rendered profiles section */ abstract renderProfiles(): T; /** * Render the education section of the resume. * * @returns {string} The rendered education section */ abstract renderEducation(): T; /** * Render the work section of the resume. * * @returns {string} The rendered work section */ abstract renderWork(): T; /** * Render the languages section of the resume. * * @returns {string} The rendered languages section */ abstract renderLanguages(): T; /** * Render the skills section of the resume. * * @returns {string} The rendered skills section */ abstract renderSkills(): T; /** * Render the awards section of the resume. * * @returns {string} The rendered awards section */ abstract renderAwards(): T; /** * Render the certificates section of the resume. * * @returns {string} The rendered certificates section */ abstract renderCertificates(): T; /** * Render the publications section of the resume. * * @returns {string} The rendered publications section */ abstract renderPublications(): T; /** * Render the references section of the resume. * * @returns {string} The rendered references section */ abstract renderReferences(): T; /** * Render the projects section of the resume. * * @returns {string} The rendered projects section */ abstract renderProjects(): T; /** * Render the interests section of the resume. * * @returns {string} The rendered interests section */ abstract renderInterests(): T; /** * Render the volunteer section of the resume. * * @returns {string} The rendered volunteer section */ abstract renderVolunteer(): T; /** * Render the resume. * * @returns {string | Uint8Array | Promise} The rendered resume */ abstract render(): string | Uint8Array | Promise; /** * Join multiple rendered sections into a single output. * * @param sections - The sections to join * @returns {T} The joined sections */ protected abstract joinSections(sections: T[]): T; /** * Render sections in the specified order. * * @returns {T} The rendered sections in the specified order */ protected renderOrderedSections(): T; } /** * MIT License * * Copyright (c) 2023–Present PPResume (https://ppresume.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ /** * Abstract base DOCX renderer for generating Word documents from resume data. * * This class provides common utilities and helper methods for DOCX rendering. * Specific templates should extend this class and implement the abstract * section rendering methods. * * Unlike other renderers that extend Renderer and return strings, this renderer * produces DOCX binary output via the `docx` library. The abstract methods are * implemented to return Paragraph arrays for compatibility, but the main output * is via `render()` which returns a Promise. */ declare abstract class DocxRenderer extends Renderer { /** * Code generator for generating DOCX paragraphs from AST nodes. */ protected codeGenerator: DocxCodeGenerator; /** * Markdown parser instance used for parsing summary fields. */ protected summaryParser: Parser; /** * Constructor for the DocxRenderer class. * * @param resume - The resume object * @param layoutIndex - The index of the selected layout to use. * @param summaryParser - The summary parser used to parse summary field in * various sections. */ constructor(resume: Resume, layoutIndex: number, summaryParser?: Parser); /** * Get the base font size in half-points from typography settings. * * @returns {number} Font size in half-points */ protected getBaseFontSize(): number; /** * Get the font family from typography settings. * * @returns {string | undefined} Font family name or undefined for default */ protected getFontFamily(): string | undefined; /** * Get the line spacing in twips from typography settings. * * @returns {number} Line spacing value */ protected getLineSpacing(): number; /** * Get the line spacing name from typography settings. * * @returns {LineSpacing | undefined} Line spacing option name */ protected getLineSpacingName(): LineSpacing; /** * Check whether to show icons in the document. * * @returns {boolean} Whether to show icons */ protected get showIcons(): boolean; /** * Get scaled font size based on base font size. * * @param scale - Scale factor (e.g., 2 for title = 2x base size) * @returns {number} Scaled font size in half-points */ protected getScaledFontSize(scale: number): number; /** * Whether to show raw URLs or hide them behind reasonable text. */ protected get showUrls(): boolean; /** * Parse a margin size string (e.g., "2.5cm") to twips (1/20 of a point). * * @param margin - The margin size string * @returns {number} The margin in twips */ private parseMargin; /** * Get page margins from layout settings. * * @returns {object} Page margins in twips */ protected getPageMargins(): { top: number; bottom: number; left: number; right: number; }; /** * Check whether to show page numbers. * * @returns {boolean} Whether to show page numbers */ protected getShowPageNumbers(): boolean; /** * Get the paper size dimensions in twips for the document. * * DOCX page dimensions are specified in twips (1/20 of a point). * * @returns {{ width: number, height: number }} Paper size dimensions */ protected getPaperSize(): { width: number; height: number; }; /** * Join multiple rendered sections into a single output. * * @param sections - The sections to join * @returns {Paragraph[]} The joined sections */ protected joinSections(sections: Paragraph[][]): Paragraph[]; /** * Render the preamble of the resume. * * @returns {Paragraph[]} Empty array as DOCX handled within Document directly */ renderPreamble(): Paragraph[]; /** * Create a section heading paragraph with horizontal rule. * * @param text - The heading text * @returns {Paragraph} A DOCX paragraph with heading styling */ protected createSectionHeading(text: string): Paragraph; /** * Create a subsection heading paragraph. * * @param text - The heading text * @returns {Paragraph} A DOCX paragraph with subheading styling */ protected createSubsectionHeading(text: string): Paragraph; /** * Create a normal text paragraph. * * @param text - The text content * @returns {Paragraph} A DOCX paragraph */ protected createTextParagraph(text: string): Paragraph; /** * Create a text paragraph with a bold label prefix and normal value suffix. * * @param label - The bold label text (e.g., "Keywords: ") * @param value - The normal value text * @returns {Paragraph} A DOCX paragraph with mixed bold/normal text */ protected createBoldLabelParagraph(label: string, value: string): Paragraph; /** * Create a detail line paragraph (italicized). * * @param text - The text content * @returns {Paragraph} A DOCX paragraph with italic styling */ protected createDetailParagraph(text: string): Paragraph; /** * Create a two-column layout paragraph with optional right-aligned content. * * Uses a right-aligned tab stop to push the right content to the margin. * Both left and right content can contain TextRun or ExternalHyperlink nodes. * * @param leftContent - Array of TextRun or ExternalHyperlink for the left column * @param rightContent - Optional array of TextRun or ExternalHyperlink for the right column * @param spacing - Optional spacing configuration for the paragraph * @returns {Paragraph} A DOCX paragraph with two-column layout */ protected createTwoColumnParagraph(leftContent: (TextRun | ExternalHyperlink)[], rightContent?: (TextRun | ExternalHyperlink)[], spacing?: { after?: number; line?: number; }, tabSize?: number): Paragraph; /** * Convert a markdown string to DOCX paragraphs. * * This method parses markdown content and converts it to appropriate DOCX * paragraph elements, supporting: * - Plain text paragraphs * - Bold and italic formatting * - Links (as external hyperlinks) * - Bullet lists (unordered lists) * - Ordered lists * * @param markdown - The markdown string to convert * @returns {Paragraph[]} Array of DOCX paragraphs */ protected createMarkdownParagraphs(markdown: string): Paragraph[]; /** * Create paragraphs for the basics section. * * @returns {Paragraph[]} Array of DOCX paragraphs for basics */ abstract renderBasics(): Paragraph[]; /** * Create paragraphs for the location section. * * @returns {Paragraph[]} Array of DOCX paragraphs for location */ abstract renderLocation(): Paragraph[]; /** * Create paragraphs for the profiles section. * * @returns {Paragraph[]} Array of DOCX paragraphs for profiles */ abstract renderProfiles(): Paragraph[]; /** * Create paragraphs for the summary section. * * @returns {Paragraph[]} Array of DOCX paragraphs for summary */ abstract renderSummary(): Paragraph[]; /** * Create paragraphs for the education section. * * @returns {Paragraph[]} Array of DOCX paragraphs for education */ abstract renderEducation(): Paragraph[]; /** * Create paragraphs for the work section. * * @returns {Paragraph[]} Array of DOCX paragraphs for work */ abstract renderWork(): Paragraph[]; /** * Create paragraphs for the languages section. * * @returns {Paragraph[]} Array of DOCX paragraphs for languages */ abstract renderLanguages(): Paragraph[]; /** * Create paragraphs for the skills section. * * @returns {Paragraph[]} Array of DOCX paragraphs for skills */ abstract renderSkills(): Paragraph[]; /** * Create paragraphs for the awards section. * * @returns {Paragraph[]} Array of DOCX paragraphs for awards */ abstract renderAwards(): Paragraph[]; /** * Create paragraphs for the certificates section. * * @returns {Paragraph[]} Array of DOCX paragraphs for certificates */ abstract renderCertificates(): Paragraph[]; /** * Create paragraphs for the publications section. * * @returns {Paragraph[]} Array of DOCX paragraphs for publications */ abstract renderPublications(): Paragraph[]; /** * Create paragraphs for the references section. * * @returns {Paragraph[]} Array of DOCX paragraphs for references */ abstract renderReferences(): Paragraph[]; /** * Create paragraphs for the projects section. * * @returns {Paragraph[]} Array of DOCX paragraphs for projects */ abstract renderProjects(): Paragraph[]; /** * Create paragraphs for the interests section. * * @returns {Paragraph[]} Array of DOCX paragraphs for interests */ abstract renderInterests(): Paragraph[]; /** * Create paragraphs for the volunteer section. * * @returns {Paragraph[]} Array of DOCX paragraphs for volunteer */ abstract renderVolunteer(): Paragraph[]; /** * Build the document children paragraphs. * * @returns {Paragraph[]} Array of paragraphs for the document */ protected buildDocumentChildren(): Paragraph[]; /** * Create a Document instance from the rendered sections. * * @returns {Document} A DOCX Document instance */ protected createDocument(): Document; /** * Render the resume as a DOCX Uint8Array. * * @returns {Promise} A promise that resolves to the DOCX data */ render(): Promise; /** * Render the resume as a DOCX Blob. * * @returns {Promise} A promise that resolves to the DOCX Blob */ renderDocumentBlob(): Promise; } /** * MIT License * * Copyright (c) 2023–Present PPResume (https://ppresume.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ declare class CalmDocxRenderer extends DocxRenderer { /** * Constructor for the CalmDocxRenderer class. * * @param resume - The resume object * @param layoutIndex - The index of the selected layout to use. * @param summaryParser - The summary parser used to parse summary field in * various sections. */ constructor(resume: Resume, layoutIndex: number, summaryParser?: Parser); /** * Create an external hyperlink content array for URLs. * * @param url - The URL to link to * @param smallSize - Font size for the URL text * @param fontFamily - Font family for the URL text * @returns {(TextRun | ExternalHyperlink)[] | undefined} Array with hyperlink or undefined */ private createUrlContent; /** * Create a date content array for right-aligned display. * * @param dateRange - The date range string * @param smallSize - Font size for the date text * @param fontFamily - Font family for the date text * @returns {TextRun[] | undefined} Array with italic date or undefined */ private createDateContent; /** * Create a bold title TextRun. * * @param text - The title text * @param subheadingSize - Font size for the title * @param fontFamily - Font family for the title * @returns {TextRun} Bold TextRun */ private createBoldTitle; /** * Create an italic detail TextRun. * * @param text - The detail text * @param smallSize - Font size for the detail * @param fontFamily - Font family for the detail * @returns {TextRun} Italic TextRun */ private createItalicDetail; /** * Create paragraphs for the basics section. * * Renders name and headline inline, similar to moderncv-calm LaTeX template. * * @returns {Paragraph[]} Array of DOCX paragraphs for basics */ renderBasics(): Paragraph[]; /** * Create paragraphs for the location section. * * @returns {Paragraph[]} Array of DOCX paragraphs for location */ renderLocation(): Paragraph[]; /** * Create paragraphs for the profiles section. * * @returns {Paragraph[]} Array of DOCX paragraphs for profiles */ renderProfiles(): Paragraph[]; /** * Create paragraphs for the summary section. * * @returns {Paragraph[]} Array of DOCX paragraphs for summary */ renderSummary(): Paragraph[]; /** * Create paragraphs for the education section. * * Uses two-column layout: institution left, URL right. * * @returns {Paragraph[]} Array of DOCX paragraphs for education */ renderEducation(): Paragraph[]; /** * Create paragraphs for the work section. * * Uses two-column layout: position/company left, dates right. * * @returns {Paragraph[]} Array of DOCX paragraphs for work */ renderWork(): Paragraph[]; /** * Create paragraphs for the languages section. * * @returns {Paragraph[]} Array of DOCX paragraphs for languages */ renderLanguages(): Paragraph[]; /** * Create paragraphs for the skills section. * * @returns {Paragraph[]} Array of DOCX paragraphs for skills */ renderSkills(): Paragraph[]; /** * Create paragraphs for the awards section. * * @returns {Paragraph[]} Array of DOCX paragraphs for awards */ renderAwards(): Paragraph[]; /** * Create paragraphs for the certificates section. * * @returns {Paragraph[]} Array of DOCX paragraphs for certificates */ renderCertificates(): Paragraph[]; /** * Create paragraphs for the publications section. * * @returns {Paragraph[]} Array of DOCX paragraphs for publications */ renderPublications(): Paragraph[]; /** * Create paragraphs for the references section. * * @returns {Paragraph[]} Array of DOCX paragraphs for references */ renderReferences(): Paragraph[]; /** * Create paragraphs for the projects section. * * @returns {Paragraph[]} Array of DOCX paragraphs for projects */ renderProjects(): Paragraph[]; /** * Create paragraphs for the interests section. * * @returns {Paragraph[]} Array of DOCX paragraphs for interests */ renderInterests(): Paragraph[]; /** * Create paragraphs for the volunteer section. * * @returns {Paragraph[]} Array of DOCX paragraphs for volunteer */ renderVolunteer(): Paragraph[]; } /** * MIT License * * Copyright (c) 2023–Present PPResume (https://ppresume.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ /** * HTML renderer for generating HTML5 documents from resume data. */ declare class HtmlRenderer extends Renderer { /** * Constructor for the HtmlRenderer class. * * @param resume - The resume object * @param layoutIndex - The index of the selected layout to use. * @param summaryParser - The summary parser used to parse summary field in * various sections. */ constructor(resume: Resume, layoutIndex: number, summaryParser?: Parser); /** * Get whether to show icons. */ private get showIcons(); /** * Get the CSS styles for the HTML document. * * @returns {string} The CSS styles */ private getStyles; /** * Render the preamble of the HTML document. * * @returns {string} The preamble of the HTML document. */ renderPreamble(): string; /** * Render the basics section of the resume. * * @returns {string} The rendered basics section */ renderBasics(): string; /** * Render the summary section of the resume. * * @returns {string} The rendered summary section */ renderSummary(): string; /** * Join multiple rendered sections into a single output. * * @param sections - The sections to join * @returns {string} The joined HTML sections */ protected joinSections(sections: string[]): string; /** * Render the location section of the resume. * * Note: Location is handled in renderBasics() for HTML output. * * @returns {string} Empty string as location is included in basics */ renderLocation(): string; /** * Render the profiles section of the resume. * * Note: Profiles are handled in renderBasics() for HTML output. * * @returns {string} Empty string as profiles are included in basics */ renderProfiles(): string; /** * Render the education section of the resume. * * @returns {string} The rendered education section */ renderEducation(): string; /** * Render the work section of the resume. * * @returns {string} The rendered work section */ renderWork(): string; /** * Render the languages section of the resume. * * @returns {string} The rendered languages section */ renderLanguages(): string; /** * Render the skills section of the resume. * * @returns {string} The rendered skills section */ renderSkills(): string; /** * Render the awards section of the resume. * * @returns {string} The rendered awards section */ renderAwards(): string; /** * Render the certificates section of the resume. * * @returns {string} The rendered certificates section */ renderCertificates(): string; /** * Render the publications section of the resume. * * @returns {string} The rendered publications section */ renderPublications(): string; /** * Render the references section of the resume. * * @returns {string} The rendered references section */ renderReferences(): string; /** * Render the projects section of the resume. * * @returns {string} The rendered projects section */ renderProjects(): string; /** * Render the interests section of the resume. * * @returns {string} The rendered interests section */ renderInterests(): string; /** * Render the volunteer section of the resume. * * @returns {string} The rendered volunteer section */ renderVolunteer(): string; /** * Render the footer section of the resume. * * @returns {string} The rendered footer section */ renderFooter(): string; /** * Render the complete HTML resume. * * @returns {string} The rendered HTML resume */ render(): string; } /** * MIT License * * Copyright (c) 2023–Present PPResume (https://ppresume.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ /** * Base class for LaTeX renderers. */ declare abstract class LatexRenderer extends Renderer { /** * Check if the resume is a CJK resume. */ protected isCJKResume(): boolean; /** * Render the LaTeX packages for Spanish support and other languages */ protected renderBabelConfig(): string; /** * Render the fontspec configuration. */ protected renderFontspecConfig(): string; /** * Render the LaTeX packages for CJK support */ protected renderCTeXConfig(): string; /** * Render the page layout/margins using the geometry package. * * @returns The LaTeX code for page layout/margins configuration */ protected renderGeometry(): string; /** * Render the line spacing configuration using the setspace package. * * @returns The LaTeX code for line spacing configuration */ protected renderLineSpacingConfig(): string; /** * Render URL configuration to use normal text instead of monospace. * * @returns The LaTeX code for URL configuration */ protected renderUrlConfig(): string; /** * Render auto-underline configuration for all hyperref links. * * Redefines \\href to automatically underline link text. * * @returns The LaTeX code for auto-underlining links */ protected renderHrefUnderlineConfig(): string; /** * Get FontAwesome icon for a network. */ protected getFaIcon(network: string): string; /** * Whether to show icons in the rendered LaTeX. */ protected get showIcons(): boolean; /** * Whether to show raw URLs or hide them behind reasonable text. */ protected get showUrls(): boolean; /** * Render a URL in the URL position based on showUrls setting. * * When showUrls is true, returns the URL formatted with \url{}. * When showUrls is false, returns an empty string (the URL is hidden * and should be rendered as a clickable link on the adjacent text via * renderLinkedText instead). * * @param url - The URL to render * @returns The formatted URL LaTeX code, or empty string */ protected renderUrl(url: string): string; /** * Render text that may be linked to a URL. * * When showUrls is false and a URL is provided, the text is wrapped in a * clickable \href link. Otherwise, the plain text is returned. * * @param text - The text to display * @param url - Optional URL to link the text to * @returns The text, optionally wrapped in a hyperlink */ protected renderLinkedText(text: string, url?: string): string; /** * Render a string with an icon. * * It should respect the `showIcons` option as well. * * @param icon The icon to use * @param info The string to use * @returns The string with an icon */ protected iconedString(icon: string, info: string): string; } /** * MIT License * * Copyright (c) 2023–Present PPResume (https://ppresume.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ /** * Renderer for Jake's Resume template. * * This template is based on the popular "Jake's Resume" LaTeX template * originally created by Jake Gutierrez and widely used on Overleaf. * * It uses the `article` document class with custom commands for resume * formatting, producing a clean, ATS-friendly layout with: * - Centered header with contact info separated by `$|$` * - Section headings with `\titlerule` dividers * - `tabular*` based subheadings for aligned date ranges * - Compact itemize lists for bullet points * * @see {@link https://www.overleaf.com/latex/templates/jakes-resume/syzfjbzwjncs} * @see {@link https://github.com/jakeryang/resume} */ declare class JakeRenderer extends LatexRenderer { private padding; private separator; /** * Constructor for the JakeRenderer class. * * @param resume - The resume object * @param layoutIndex - The index of the selected layout to use. * @param summaryParser - The summary parser used to parse summary field in * various sections. */ constructor(resume: Resume, layoutIndex: number, summaryParser?: Parser); protected joinSections(sections: string[]): string; /** * Render the document class configuration. * * Uses the `article` document class, respecting user-configured paper size * and font size, with Jake's defaults of letterpaper and 10pt. */ private renderDocumentClassConfig; /** * Render the fontawesome package with fallback from v7 to v5. * * Uses \IfFileExists to detect if fontawesome7 is available on the user's * system, falling back to fontawesome5 if not. Returns an empty string if * showIcons is false. * * @returns The LaTeX code for loading fontawesome package, or empty string * if icons are disabled */ private renderFontawesome; /** * Render the LaTeX packages required by Jake's Resume template. */ private renderPackages; /** * Render the page layout/margin configuration. */ private renderPageNumbersConfig; /** * Render the section formatting configuration. */ private renderSectionFormatting; /** * Render the custom resume commands used by Jake's template. */ private renderCustomCommands; /** * Render PDF metadata using hyperref. */ private renderPdfMetadata; /** * Render the preamble for the resume. * * @returns The LaTeX code for the preamble */ renderPreamble(): string; /** * Render the basics section (centered header). * * @returns The LaTeX code for the heading */ renderBasics(): string; /** * Render the location (full address) as the first line of contact info. * * @returns The LaTeX code for the location line */ renderLocation(): string; /** * Render homepage and profiles as the third line of contact info. * * @returns The LaTeX code for the homepage/profiles line */ renderProfiles(): string; /** * Render the summary section. * * @returns The LaTeX code for the summary section */ renderSummary(): string; /** * Render the education section. * * @returns The LaTeX code for the education section */ renderEducation(): string; /** * Render the work section. * * @returns The LaTeX code for the work section */ renderWork(): string; /** * Render the languages section. * * Uses Jake's Technical Skills pattern with label: value format. * * @returns The LaTeX code for the languages section */ renderLanguages(): string; /** * Render the skills section. * * Uses Jake's Technical Skills pattern with label: keywords format. * * @returns The LaTeX code for the skills section */ renderSkills(): string; /** * Render the awards section. * * @returns The LaTeX code for the awards section */ renderAwards(): string; /** * Render the certificates section. * * @returns The LaTeX code for the certificates section */ renderCertificates(): string; /** * Render the publications section. * * @returns The LaTeX code for the publications section */ renderPublications(): string; /** * Render the references section. * * @returns The LaTeX code for the references section */ renderReferences(): string; /** * Render the projects section. * * Uses the `\resumeSubheading` command for consistent layout with other * sections like volunteer. * * @returns The LaTeX code for the projects section */ renderProjects(): string; /** * Render the interests section. * * Uses Jake's Technical Skills pattern. * * @returns The LaTeX code for the interests section */ renderInterests(): string; /** * Render the volunteer section. * * @returns The LaTeX code for the volunteer section */ renderVolunteer(): string; /** * Render the resume. * * @returns The LaTeX code for the resume */ render(): string; /** * Generate the LaTeX code for the resume. * * Assembles the preamble, header (basics + location + profiles in a * centered block), and ordered sections into a complete LaTeX document. * * @returns The LaTeX code for the resume */ private generateTeX; } /** * The style options for the moderncv document class. * * These styles control the visual appearance and layout of the CV. There're * actually 5 styles in moderncv package, but only 3 are supported in this * project, `fancy` and `oldstyle` is pretty buggy and not working well. * * - `banking` - a modern, professional style with a banking/financial aesthetic * - `classic` - a traditional CV style with a clean, formal layout * - `casual` - a more relaxed style while maintaining professionalism * * @see {@link https://github.com/yamlresume/community/issues/117} */ declare const MODERNCV_STYLE_OPTIONS: readonly ["banking", "classic", "casual"]; /** The type of moderncv style. */ type ModerncvStyle = (typeof MODERNCV_STYLE_OPTIONS)[number]; /** * MIT License * * Copyright (c) 2023–Present PPResume (https://ppresume.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ /** * Base class for moderncv renderers. */ declare class ModerncvBase extends LatexRenderer { style: ModerncvStyle; /** * Constructor for the ModerncvBase class. * * @param resume - The resume object * @param style - The moderncv style * @param layoutIndex - The index of the selected layout to use. * @param summaryParser - The summary parser used to parse summary field in * various sections. */ constructor(resume: Resume, style: ModerncvStyle, layoutIndex: number, summaryParser: Parser); /** * Render the document class configuration. */ private renderDocumentClassConfig; /** * Override the moderncv commands for CJK resumes */ private renderModerncvOverride; /** * Render the moderncv configuration. */ private renderModerncvConfig; /** * Render the page numbers configuration. */ private renderPageNumbersConfig; /** * Render a redefinition of \httplink and \httpslink to support full URLs. * * The original moderncv \httplink and \httpslink macros always prepend * the protocol (http:// or https://) to the URL. This causes issues when * the URL already contains a protocol (e.g., https://example.com), resulting * in malformed URLs like https://https://example.com. * * This redefinition checks if the URL already contains "://" and if so, * uses the URL directly without prepending the protocol. * * Note: We use \str_set:Nx (with x-expansion) to fully expand the argument * before converting to a string. This is necessary because moderncv passes * the URL via a macro (\@homepage), and without expansion we would be * checking the literal string "\@homepage" instead of its value. * We then use \str_if_in:NnTF to check for "://" in the expanded URL. * * @returns The LaTeX code for the httplink/httpslink redefinition */ private renderHomepageRedefinition; /** * Render the preamble for the resume. * * @returns The LaTeX code for the preamble */ renderPreamble(): string; /** * Join multiple rendered sections into a single output. * * @param sections - The sections to join * @returns {string} The joined LaTeX sections */ protected joinSections(sections: string[]): string; /** * Render the basics section of the resume. * * @returns The LaTeX code for the basics section */ renderBasics(): string; /** * Render the location section of the resume. * * @returns The LaTeX code for the location section */ renderLocation(): string; /** * Render the profiles section of the resume. * * @returns The LaTeX code for the profiles section */ renderProfiles(): string; /** * Render the summary section of the resume. * * @returns The LaTeX code for the summary section */ renderSummary(): string; /** * Render the education section of the resume. * * @returns The LaTeX code for the education section */ renderEducation(): string; /** * Render the work section of the resume. * * @returns The LaTeX code for the work section */ renderWork(): string; /** * Render the languages section of the resume. * * @returns The LaTeX code for the languages section */ renderLanguages(): string; /** * Render the skills section of the resume. * * @returns The LaTeX code for the skills section */ renderSkills(): string; /** * Render the awards section of the resume. * * @returns The LaTeX code for the awards section */ renderAwards(): string; /** * Render the certificates section of the resume. * * @returns The LaTeX code for the certificates section */ renderCertificates(): string; /** * Render the publications section of the resume. * * @returns The LaTeX code for the publications section */ renderPublications(): string; /** * Render the references section of the resume. * * @returns The LaTeX code for the references section */ renderReferences(): string; /** * Render the projects section of the resume. * * @returns The LaTeX code for the projects section */ renderProjects(): string; /** * Render the interests section of the resume. * * @returns The LaTeX code for the interests section */ renderInterests(): string; /** * Render the volunteer section of the resume. * * @returns The LaTeX code for the volunteer section */ renderVolunteer(): string; /** * Render the resume. * * @returns The LaTeX code for the resume */ render(): string; /** * Generate the LaTeX code for the resume. * * @returns The LaTeX code for the resume */ private generateTeX; } /** * Renderer for the banking style of moderncv. */ declare class ModerncvBankingRenderer extends ModerncvBase { /** * Create moderncv renderer with banking style. * * @param resume - The resume object to render. * @param layoutIndex - The index of the selected layout to use. * @param summaryParser - Optional parser for summary fields (defaults to markdown). */ constructor(resume: Resume, layoutIndex: number, summaryParser?: Parser); } /** * Renderer for the casual style of moderncv. */ declare class ModerncvCasualRenderer extends ModerncvBase { /** * Create a moderncv renderer with casual style. * * @param resume - The resume object to render. * @param layoutIndex - The index of the selected layout to use. * @param summaryParser - Optional parser for summary fields (defaults to markdown). */ constructor(resume: Resume, layoutIndex: number, summaryParser?: Parser); } /** * Renderer for the classic style of moderncv. */ declare class ModerncvClassicRenderer extends ModerncvBase { /** * Create moderncv renderer with classic style. * * @param resume - The resume object to render. * @param layoutIndex - The index of the selected layout to use. * @param summaryParser - Optional parser for summary fields (defaults to markdown). */ constructor(resume: Resume, layoutIndex: number, summaryParser?: Parser); } /** * MIT License * * Copyright (c) 2023–Present PPResume (https://ppresume.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ /** * Markdown renderer for generating markdown documents from resume data. */ declare class MarkdownRenderer extends Renderer { /** * Constructor for the MarkdownRenderer class. * * @param resume - The resume object * @param layoutIndex - The index of the selected layout to use. * @param summaryParser - The summary parser used to parse summary field in * various sections. */ constructor(resume: Resume, layoutIndex: number, summaryParser?: Parser); /** * Render the preamble of the markdown document. * * Please note that markdown output do not need a preamble. * * @returns {string} The preamble of the markdown document. */ renderPreamble(): string; /** * Render the basics section of the resume. * * @returns {string} The rendered basics section */ renderBasics(): string; /** * Render the summary section of the resume. * * @returns {string} The rendered summary section */ renderSummary(): string; /** * Join multiple rendered sections into a single output. * * @param sections - The sections to join * @returns {string} The joined Markdown sections */ protected joinSections(sections: string[]): string; /** * Render the location section of the resume. * * @returns {string} The rendered location section */ renderLocation(): string; /** * Render the profiles section of the resume. * * @returns {string} The rendered profiles section */ renderProfiles(): string; /** * Render the education section of the resume. * * @returns {string} The rendered education section */ renderEducation(): string; /** * Render the work section of the resume. * * @returns {string} The rendered work section */ renderWork(): string; /** * Render the languages section of the resume. * * @returns {string} The rendered languages section */ renderLanguages(): string; /** * Render the skills section of the resume. * * @returns {string} The rendered skills section */ renderSkills(): string; /** * Render the awards section of the resume. * * @returns {string} The rendered awards section */ renderAwards(): string; /** * Render the certificates section of the resume. * * @returns {string} The rendered certificates section */ renderCertificates(): string; /** * Render the publications section of the resume. * * @returns {string} The rendered publications section */ renderPublications(): string; /** * Render the references section of the resume. * * @returns {string} The rendered references section */ renderReferences(): string; /** * Render the projects section of the resume. * * @returns {string} The rendered projects section */ renderProjects(): string; /** * Render the interests section of the resume. * * @returns {string} The rendered interests section */ renderInterests(): string; /** * Render the volunteer section of the resume. * * @returns {string} The rendered volunteer section */ renderVolunteer(): string; /** * Render the complete markdown resume. * * @returns {Promise} The rendered markdown resume */ render(): string; } /** * MIT License * * Copyright (c) 2023–Present PPResume (https://ppresume.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ /** * Get the appropriate resume renderer based on the provided resume layout. * * @param {number} layoutIndex - The index of the layout to use. * @param {Parser} summaryParser - The parser instance for the summary field. * Default to `MarkdownParser` if not provided. * @returns {Renderer} The renderer instance for the specified template. */ declare function getResumeRenderer(resume: Resume, layoutIndex: number, summaryParser?: Parser): CalmDocxRenderer | HtmlRenderer | JakeRenderer | ModerncvBankingRenderer | ModerncvCasualRenderer | ModerncvClassicRenderer | MarkdownRenderer; /** * MIT License * * Copyright (c) 2023–Present PPResume (https://ppresume.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ /** * A zod schema for a yaml resume. */ declare const ResumeSchema: z.ZodObject<{ layouts: z.ZodOptional; showIcons: z.ZodDefault; }, z.core.$strip>>>; typography: z.ZodOptional>>>; fontFamily: z.ZodOptional>>>; lineSpacing: z.ZodOptional>>>; }, z.core.$strip>>>; template: z.ZodOptional>>>; page: z.ZodOptional>>>; bottom: z.ZodOptional>>>; left: z.ZodOptional>>>; right: z.ZodOptional>>>; }, z.core.$strip>>>; showPageNumbers: z.ZodOptional>>>; paperSize: z.ZodOptional>>>; }, z.core.$strip>>>; sections: z.ZodOptional>>>; aliases: z.ZodOptional>>>; education: z.ZodOptional>>>; work: z.ZodOptional>>>; volunteer: z.ZodOptional>>>; awards: z.ZodOptional>>>; certificates: z.ZodOptional>>>; publications: z.ZodOptional>>>; skills: z.ZodOptional>>>; languages: z.ZodOptional>>>; interests: z.ZodOptional>>>; references: z.ZodOptional>>>; projects: z.ZodOptional>>>; }, z.core.$strip>>>; }, z.core.$strip>>>; engine: z.ZodLiteral<"docx">; }, z.core.$strip>, z.ZodObject<{ sections: z.ZodOptional>>>; aliases: z.ZodOptional>>>; education: z.ZodOptional>>>; work: z.ZodOptional>>>; volunteer: z.ZodOptional>>>; awards: z.ZodOptional>>>; certificates: z.ZodOptional>>>; publications: z.ZodOptional>>>; skills: z.ZodOptional>>>; languages: z.ZodOptional>>>; interests: z.ZodOptional>>>; references: z.ZodOptional>>>; projects: z.ZodOptional>>>; }, z.core.$strip>>>; }, z.core.$strip>>>; advanced: z.ZodOptional; title: z.ZodOptional; footer: z.ZodDefault; description: z.ZodOptional; keywords: z.ZodOptional; }, z.core.$strip>>>; typography: z.ZodOptional>>>; fontFamily: z.ZodOptional>>>; lineSpacing: z.ZodOptional>>>; }, z.core.$strip>>>; template: z.ZodOptional>>>; engine: z.ZodLiteral<"html">; }, z.core.$strip>, z.ZodObject<{ sections: z.ZodOptional>>>; aliases: z.ZodOptional>>>; education: z.ZodOptional>>>; work: z.ZodOptional>>>; volunteer: z.ZodOptional>>>; awards: z.ZodOptional>>>; certificates: z.ZodOptional>>>; publications: z.ZodOptional>>>; skills: z.ZodOptional>>>; languages: z.ZodOptional>>>; interests: z.ZodOptional>>>; references: z.ZodOptional>>>; projects: z.ZodOptional>>>; }, z.core.$strip>>>; }, z.core.$strip>>>; advanced: z.ZodOptional>>>; }, z.core.$strip>>>; showIcons: z.ZodDefault; showUrls: z.ZodDefault; }, z.core.$strip>>>; typography: z.ZodOptional; }, z.core.$strip>>>; fontSize: z.ZodOptional>>>; fontFamily: z.ZodOptional>>>; lineSpacing: z.ZodOptional>>>; }, z.core.$strip>>>; template: z.ZodOptional>>>; page: z.ZodOptional>>>; bottom: z.ZodOptional>>>; left: z.ZodOptional>>>; right: z.ZodOptional>>>; }, z.core.$strip>>>; showPageNumbers: z.ZodOptional>>>; paperSize: z.ZodOptional>>>; }, z.core.$strip>>>; engine: z.ZodLiteral<"latex">; }, z.core.$strip>, z.ZodObject<{ sections: z.ZodOptional>>>; aliases: z.ZodOptional>>>; education: z.ZodOptional>>>; work: z.ZodOptional>>>; volunteer: z.ZodOptional>>>; awards: z.ZodOptional>>>; certificates: z.ZodOptional>>>; publications: z.ZodOptional>>>; skills: z.ZodOptional>>>; languages: z.ZodOptional>>>; interests: z.ZodOptional>>>; references: z.ZodOptional>>>; projects: z.ZodOptional>>>; }, z.core.$strip>>>; }, z.core.$strip>>>; engine: z.ZodLiteral<"markdown">; }, z.core.$strip>], "engine">>>>; locale: z.ZodOptional>>>; }, z.core.$strip>>>; content: z.ZodObject<{ work: z.ZodOptional>>>; keywords: z.ZodOptional>>>; url: z.ZodOptional>>>; }, z.core.$strip>>>>; volunteer: z.ZodOptional>>>; url: z.ZodOptional>>>; }, z.core.$strip>>>>; skills: z.ZodOptional; name: z.ZodString; keywords: z.ZodOptional>>>; }, z.core.$strip>>>>; references: z.ZodOptional>>>; phone: z.ZodOptional>>>; relationship: z.ZodOptional>>>; }, z.core.$strip>>>>; publications: z.ZodOptional>>>; summary: z.ZodOptional>>>; url: z.ZodOptional>>>; }, z.core.$strip>>>>; projects: z.ZodOptional>>>; endDate: z.ZodOptional>>>; keywords: z.ZodOptional>>>; url: z.ZodOptional>>>; }, z.core.$strip>>>>; profiles: z.ZodOptional; username: z.ZodString; url: z.ZodOptional>>>; }, z.core.$strip>>>>; location: z.ZodOptional>>>; country: z.ZodOptional>>>; postalCode: z.ZodOptional>>>; region: z.ZodOptional>>>; }, z.core.$strip>>>; languages: z.ZodOptional; language: z.ZodEnum<{ Afrikaans: "Afrikaans"; Albanian: "Albanian"; Amharic: "Amharic"; Arabic: "Arabic"; Azerbaijani: "Azerbaijani"; Belarusian: "Belarusian"; Bengali: "Bengali"; Bhojpuri: "Bhojpuri"; Bulgarian: "Bulgarian"; Burmese: "Burmese"; Cantonese: "Cantonese"; Catalan: "Catalan"; Chinese: "Chinese"; Croatian: "Croatian"; Czech: "Czech"; Danish: "Danish"; Dutch: "Dutch"; English: "English"; Estonian: "Estonian"; Farsi: "Farsi"; Filipino: "Filipino"; Finnish: "Finnish"; French: "French"; German: "German"; Greek: "Greek"; Gujarati: "Gujarati"; Hausa: "Hausa"; Hebrew: "Hebrew"; Hindi: "Hindi"; Hungarian: "Hungarian"; Icelandic: "Icelandic"; Igbo: "Igbo"; Indonesian: "Indonesian"; Irish: "Irish"; Italian: "Italian"; Japanese: "Japanese"; Javanese: "Javanese"; Kazakh: "Kazakh"; Khmer: "Khmer"; Korean: "Korean"; Lahnda: "Lahnda"; Latvian: "Latvian"; Lithuanian: "Lithuanian"; Malay: "Malay"; Mandarin: "Mandarin"; Marathi: "Marathi"; Nepali: "Nepali"; Norwegian: "Norwegian"; Oromo: "Oromo"; Pashto: "Pashto"; Polish: "Polish"; Portuguese: "Portuguese"; Romanian: "Romanian"; Russian: "Russian"; Serbian: "Serbian"; Shona: "Shona"; Sinhala: "Sinhala"; Slovak: "Slovak"; Slovene: "Slovene"; Somali: "Somali"; Spanish: "Spanish"; Sundanese: "Sundanese"; Swahili: "Swahili"; Swedish: "Swedish"; Tagalog: "Tagalog"; Tamil: "Tamil"; Telugu: "Telugu"; Thai: "Thai"; Turkish: "Turkish"; Ukrainian: "Ukrainian"; Urdu: "Urdu"; Uzbek: "Uzbek"; Vietnamese: "Vietnamese"; Yoruba: "Yoruba"; Zulu: "Zulu"; }>; keywords: z.ZodOptional>>>; }, z.core.$strip>>>>; interests: z.ZodOptional>>>; }, z.core.$strip>>>>; certificates: z.ZodOptional>>>; url: z.ZodOptional>>>; }, z.core.$strip>>>>; awards: z.ZodOptional>>>; summary: z.ZodOptional>>>; }, z.core.$strip>>>>; education: z.ZodArray; startDate: z.ZodString; courses: z.ZodOptional>>>; endDate: z.ZodOptional>>>; summary: z.ZodOptional>>>; score: z.ZodOptional>>>; url: z.ZodOptional>>>; }, z.core.$strip>>; basics: z.ZodObject<{ name: z.ZodString; email: z.ZodOptional>>>; headline: z.ZodOptional>>>; phone: z.ZodOptional>>>; summary: z.ZodOptional>>>; url: z.ZodOptional>>>; }, z.core.$strip>; }, z.core.$strip>; }, z.core.$strip>; /** * MIT License * * Copyright (c) 2023–Present PPResume (https://ppresume.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ /** Defines the structure for translated terms for a single language. */ type OptionTranslation = { /** Translations for country names. */ countries: Record; /** Translations for degree types. */ degrees: Record; /** Translations for language fluency levels. */ fluency: Record; /** Translations for language names. */ languages: Record; /** Translations for resume section titles. */ sections: Record; /** Translations for skill proficiency levels. */ skills: Record; }; type OptionCategory = keyof OptionTranslation; /** * Retrieves the translated terms for a specific locale language. * * Includes translations for degrees, languages, fluencies, countries, section * titles, levels, and other specific terms. * * @param language - The desired locale language. If undefined, defaults to * English. * @returns An object containing the translated terms for the specified * language. */ declare function getOptionTranslation(language: LocaleLanguage, category: K, option: keyof OptionTranslation[K]): string; /** * MIT License * * Copyright (c) 2023–Present PPResume (https://ppresume.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ /** Specific punctuation types used for formatting within templates. */ declare const PUNCTUATIONS: readonly ["comma", "colon", "separator"]; /** The type of punctuation. */ type Punctuation = (typeof PUNCTUATIONS)[number]; /** Specific terms used within the template structure that need translation. */ declare const TERMS: readonly ["courses", "keywords", "score"]; /** The type of term. */ type Term = (typeof TERMS)[number]; /** The structure for template-specific translations (punctuations and terms) */ type TemplateTranslationValue = { /** Translations for punctuation types defined in `Punctuation`. */ punctuations: Record; /** Translations for template terms defined in `Term`. */ terms: Record; }; /** * Retrieves template-specific translations (punctuations and terms) for a given * locale language. * * @param language - The desired locale language. If undefined, defaults to * English. * @returns An object containing the translated punctuations and terms for the * specified language. */ declare function getTemplateTranslations(language?: LocaleLanguage): TemplateTranslationValue; /** * MIT License * * Copyright (c) 2023–Present PPResume (https://ppresume.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ /** * Generic function to merge custom order with default order. * * Items specified in customOrder will have higher priority and appear first * in the result. Remaining items will follow in the default order. * * Duplicate items in customOrder will be deduplicated (first occurrence kept). * Items in customOrder that are not in defaultOrder will be ignored. * * @param customOrder - Array of items with custom priority order * @param defaultOrder - Array of items in default order * @returns Merged order array */ declare function mergeArrayWithOrder(customOrder: T[] | undefined | null, defaultOrder: T[]): T[]; /** * MIT License * * Copyright (c) 2023–Present PPResume (https://ppresume.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ /** * Parse date from a string * * @param dateStr - date string, `null` or `undefined` * @returns Date object if parse success, otherwise `null` */ declare function parseDate(dateStr: string | undefined | null): Date | null; /** * Localize a date string to a specific language. * * @param date - The date string to localize. * @param language - The language to localize the date string to. * @returns The localized date string. */ declare function localizeDate(date: string, language: LocaleLanguage | string): string; /** * Get the date range for a given start and end date. * * @param startDate - The start date. * @param endDate - The end date. * @param language - The language to localize the date string to. * @returns The date range. */ declare function getDateRange(startDate: string, endDate: string, language: LocaleLanguage): string; /** * The number of seconds in one day */ declare const ONE_DAY: number; /** * Get the current time in UTC seconds * * @returns The current time in UTC seconds */ declare function nowInUTCSeconds(): number; /** * Generate a local date string without timestamp for a epoch time in seconds * * @param epochTime - epoch time in seconds * @param locale - locale for the date string * @returns - a human readable date string */ declare function epochSecondsToLocaleDateString(epochTime: number, locale?: string): string; /** * Convert milliseconds to seconds */ declare function milliSecondsToSeconds(ms: number): number; /** * MIT License * * Copyright (c) 2023–Present PPResume (https://ppresume.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ /** * Parse a font size string (e.g., "11pt") to half-points. * * DOCX uses half-points for font sizes, so "11pt" becomes 22. * * @param fontSize - The font size string (e.g., "11pt") * @param defaultSize - The default size to return if parsing fails * @returns The font size in half-points */ declare function parseFontSizeToHalfPoints(fontSize: string | undefined, defaultSize: number): number; /** * MIT License * * Copyright (c) 2023–Present PPResume (https://ppresume.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ /** * Check if a value is empty * * Empty values include `undefined`, `null`, empty object and empty string * * @param value - value to check * @returns True if value is empty, false otherwise * * @see {@link https://stackoverflow.com/a/43233163} */ declare function isEmptyValue(value: undefined | null | object | string): boolean; /** * Remove keys from an object by their names * * @param obj - The object to remove keys from * @param keysToRemove - The keys to remove * @returns The object with the specified keys removed */ declare function removeKeysFromObject(obj: T, keysToRemove: (string | number | symbol)[]): T; /** * Tree walker function to collect all possible keys from an object recursively * * This function traverses an object tree and collects all property keys at any * depth. It handles arrays, nested objects, and prevents infinite loops from * circular references. * * @param obj - The object to walk through * @param keys - Set to collect all keys (optional, used for recursion) * @param visited - Set to track visited objects to prevent circular references * (optional, used for recursion) * @returns Set containing all keys found in the object tree * * @example * ```typescript * const obj = { * a: 1, * b: { * c: 2, * d: [{ e: 3 }] * } * } * const keys = collectAllKeys(obj) * // keys will contain: Set(['a', 'b', 'c', 'd', 'e']) * ``` */ declare function collectAllKeys(obj: unknown, keys?: Set, visited?: WeakSet): Set; /** * MIT License * * Copyright (c) 2023–Present PPResume (https://ppresume.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ /** * Escape HTML entities in text. * * @param text - The text to escape. * @returns The escaped text. */ declare function escapeHtml(text: string): string; /** * A wrapper around the escape-latex that handles null and undefined values. * * @param value - value to be escaped * @returns escaped value */ declare function escapeLatex(value: string | null | undefined): any; /** * Check if a string is empty or only contains whitespace * * @param value - string to check * @returns True if string is empty or only contains whitespace, false otherwise */ declare function isEmptyString(value: string): boolean; /** * Show content if predicate is true * * @param predicate - The predicate to check * @param content - The content to show * @returns The content if predicate is true, empty string otherwise */ declare function showIf(predicate: boolean, content: string): string; /** * Show content if value is not empty * * @param value - The value to check (undefined, null, object, or string) * @param content - The content to show * @returns The content if value is not empty, empty string otherwise */ declare function showIfNotEmpty(value: undefined | null | object | string, content: string): string; /** * Join an array of strings , but only if the string is not empty * * @param codes - The array of strings to join * @param separator - The separator to join the strings with * @returns The joined string */ declare function joinNonEmptyString(codes: string[], separator?: string): string; /** * Convert a string to a code block in markdown format * * @param code - The string to convert * @param lang - The language of the code block * @returns The code block */ declare function toCodeBlock(code?: string, lang?: string): string; export { type Awards, type Basics, type BoldMark, BrazilianPortugueseCountryNames, type BulletListNode, COUNTRY_OPTIONS, type Certificates, type Content, type Country, DEFAULT_DOCX_LAYOUT, DEFAULT_HTML_LAYOUT, DEFAULT_LATEX_LAYOUT, DEFAULT_MARKDOWN_LAYOUT, DEFAULT_RESUME, DEFAULT_RESUME_CONTENT, DEFAULT_RESUME_LAYOUTS, DEFAULT_RESUME_LOCALE, DEFAULT_SECTIONS_ORDER, DEGREE_OPTIONS, DOCX_FONT_SIZE_OPTIONS, DOCX_PAPER_SIZE_OPTIONS, DOCX_TEMPLATE_OPTIONS, type Degree, type DocNode, DocxCodeGenerator, type DocxFontSize, type DocxLayout, type DocxPaperSize, DocxRenderer, type DocxTemplate, DutchCountryNames, type Education, EnglishCountryNames, ErrorType, FILLED_RESUME, FILLED_RESUME_CONTENT, FLUENCY_OPTIONS, type Fluency, type Fragment, FrenchCountryNames, GermanCountryNames, HTML_FONT_SIZE_OPTIONS, HTML_TEMPLATE_OPTIONS, HtmlCodeGenerator, type HtmlFontSize, type HtmlLayout, HtmlRenderer, type HtmlTemplate, IndonesianCountryNames, type Interests, type ItalicMark, JakeRenderer, JapaneseCountryNames, type Keywords, LANGUAGE_OPTIONS, LATEX_FONTSPEC_NUMBERS_OPTIONS, LATEX_FONT_SIZE_OPTIONS, LATEX_PAPER_SIZE_OPTIONS, LATEX_TEMPLATE_OPTIONS, LEVEL_OPTIONS, LINE_SPACING_OPTIONS, LOCALE_LANGUAGE_OPTIONS, type Language, type Languages, LatexCodeGenerator, type LatexFontSize, type LatexFontspecNumbers, type LatexLayout, type LatexPaperSize, type LatexTemplate, type LayoutEngine, type Layouts, type Level, type LineSpacing, type LinkMark, type ListItemNode, type Locale, type LocaleLanguage, type Location, MARGIN_OPTIONS, type Mark, type MarkdownLayout, MarkdownParser, MarkdownRenderer, ModerncvBankingRenderer, ModerncvCasualRenderer, ModerncvClassicRenderer, NETWORK_OPTIONS, type Network, type Node, NorwegianCountryNames, ONE_DAY, ORDERABLE_SECTION_IDS, type OrderableSectionID, type OrderedListNode, PUNCTUATIONS, type ParagraphNode, type Parser, type Profiles, type Projects, type Publications, type Punctuation, RESUME_SECTION_ITEMS, type References, type Resume, type ResumeItem, ResumeSchema, SECTION_IDS, type SectionID, SimplifiedChineseCountryNames, type Skills, SpanishCountryNames, TERMS, type Term, type TextNode, TraditionalChineseCountryHKNames, TraditionalChineseCountryTWNames, type Volunteer, type Work, YAMLResumeError, collectAllKeys, epochSecondsToLocaleDateString, escapeHtml, escapeLatex, getDateRange, getDocxTemplateDetail, getHtmlTemplateDetail, getLatexTemplateDetail, getLocaleLanguageDetail, getOptionTranslation, getResumeRenderer, getTemplateTranslations, isEmptyString, isEmptyValue, joinNonEmptyString, localizeDate, mergeArrayWithOrder, milliSecondsToSeconds, nowInUTCSeconds, parseDate, parseFontSizeToHalfPoints, removeKeysFromObject, showIf, showIfNotEmpty, toCodeBlock, transformResume };