UNPKG

@yamlresume/core

Version:

The typesetting and layout core for YAMLResume

1,287 lines (1,266 loc) 151 kB
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<Country, string>; /** * Represents all possible countries & regions with their corresponding * Simplified Chinese names. */ declare const SimplifiedChineseCountryNames: Record<Country, string>; /** * Represents all possible countries & regions with their corresponding * Traditional Chinese HK names. */ declare const TraditionalChineseCountryHKNames: Record<Country, string>; /** * Represents all possible countries & regions with their corresponding * Traditional Chinese TW names. */ declare const TraditionalChineseCountryTWNames: Record<Country, string>; /** * Represents all possible countries & regions with their corresponding * Spanish names. */ declare const SpanishCountryNames: Record<Country, string>; /** * Represents all possible countries & regions with their corresponding * French names. */ declare const FrenchCountryNames: Record<Country, string>; declare const NorwegianCountryNames: Record<Country, string>; /** * Represents all possible countries & regions with their corresponding Dutch names. */ declare const DutchCountryNames: Record<Country, string>; /** * Represents all possible countries & regions with their corresponding Japanese names. */ declare const JapaneseCountryNames: Record<Country, string>; /** * Represents all possible countries & regions with their corresponding German names. */ declare const GermanCountryNames: Record<Country, string>; /** * Represents all possible countries & regions with their corresponding Indonesian names. */ declare const IndonesianCountryNames: Record<Country, 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 all possible degrees. */ declare const DEGREE_OPTIONS: readonly ["Middle School", "High School", "Diploma", "Associate", "Bachelor", "Master", "Doctor"]; /** * 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"]; /** The options for the latex layout font size. */ declare const LATEX_FONT_SIZE_OPTIONS: readonly ["10pt", "11pt", "12pt"]; /** The options for the paper size. */ declare const LATEX_PAPER_SIZE_OPTIONS: readonly ["a4", "letter"]; /** The options for the HTML layout font size. */ declare const HTML_FONT_SIZE_OPTIONS: readonly ["14px", "15px", "16px", "17px", "18px", "19px", "20px"]; /** Defines identifiers for the available HTML layout templates. */ declare const HTML_TEMPLATE_OPTIONS: readonly ["calm", "vscode"]; /** The options for the latex layout fontspec numbers style. */ declare const LATEX_FONTSPEC_NUMBERS_OPTIONS: readonly ["Lining", "OldStyle", "Auto"]; /** Defines identifiers for the available latex layout templates. */ declare const LATEX_TEMPLATE_OPTIONS: readonly ["jake", "moderncv-banking", "moderncv-casual", "moderncv-classic"]; /** * 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 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 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"]; /** * 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 language fluency levels. */ type Fluency = (typeof FLUENCY_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 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]; /** * 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 = 'html' | 'latex' | 'markdown'; /** * Defines section alias settings for customizing section names. */ type Sections = { /** Custom aliases for section names, overriding default translations. */ aliases?: Partial<Record<SectionID, string>>; /** 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. */ /** * 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; }; /** * 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; 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