/** * Constants for ORCID Parser * * @packageDocumentation * @license BSD-3-Clause * @author Sira Pornsiriprasert * @module constants */ /** * Constants for all ORCID work types, according to https://info.orcid.org/ufaqs/what-work-types-does-orcid-support/. * * @example * ```ts * // Filter works by type * const articles = filterByType(works, WORK_TYPES.ARTICLE); * ``` */ export declare const WORK_TYPES: { /** Standard journal article publication */ readonly ARTICLE: "journal-article"; /** Complete book publication */ readonly BOOK: "book"; /** Chapter or section within a book */ readonly BOOK_CHAPTER: "book-chapter"; /** Paper presented at a conference */ readonly CONFERENCE_PAPER: "conference-paper"; /** Published conference proceedings volume */ readonly CONFERENCE_PROCEEDINGS: "conference-proceedings"; /** Poster presented at a conference */ readonly CONFERENCE_POSTER: "conference-poster"; /** Oral presentation at a conference */ readonly CONFERENCE_PRESENTATION: "conference-presentation"; /** Generic conference output (abstracts, extended abstracts) */ readonly CONFERENCE_OUTPUT: "conference-output"; /** Doctoral dissertation or master's thesis */ readonly DISSERTATION: "dissertation-thesis"; /** Preprint or manuscript before peer review */ readonly PREPRINT: "preprint"; /** Working paper or draft publication */ readonly WORKING_PAPER: "working-paper"; /** Annotation or commentary on another work */ readonly ANNOTATION: "annotation"; /** Critical review of a book */ readonly BOOK_REVIEW: "book-review"; /** Complete journal issue (editorial role) */ readonly JOURNAL_ISSUE: "journal-issue"; /** Review article or peer review */ readonly REVIEW: "review"; /** Blog post or web article */ readonly BLOG_POST: "blog-post"; /** Entry in a dictionary */ readonly DICTIONARY_ENTRY: "dictionary-entry"; /** Entry in an encyclopedia */ readonly ENCYCLOPEDIA_ENTRY: "encyclopedia-entry"; /** Article published in a magazine */ readonly MAGAZINE_ARTICLE: "magazine-article"; /** Article published in a newspaper */ readonly NEWSPAPER_ARTICLE: "newspaper-article"; /** Public speech or address */ readonly PUBLIC_SPEECH: "public-speech"; /** Technical or research report */ readonly REPORT: "report"; /** Website or web resource */ readonly WEBSITE: "website"; /** Artistic performance (theater, dance, music) */ readonly ARTISTIC_PERFORMANCE: "artistic-performance"; /** Design work (graphic, industrial, architectural) */ readonly DESIGN: "design"; /** Still image, photograph, or illustration */ readonly IMAGE: "image"; /** Generic online resource */ readonly ONLINE_RESOURCE: "online-resource"; /** Video, film, or animation */ readonly MOVING_IMAGE: "moving-image"; /** Musical composition or score */ readonly MUSICAL_COMPOSITION: "musical-composition"; /** Audio recording or sound work */ readonly SOUND: "sound"; /** Maps, atlases, or cartographic materials */ readonly CARTOGRAPHIC_MATERIAL: "cartographic-material"; /** Clinical trial or medical study */ readonly CLINICAL_STUDY: "clinical-study"; /** Research dataset or data collection */ readonly DATASET: "data-set"; /** Data management plan for research */ readonly DATA_MANAGEMENT_PLAN: "data-management-plan"; /** Physical object or artifact */ readonly PHYSICAL_OBJECT: "physical-object"; /** Research methodology or technique */ readonly RESEARCH_TECHNIQUE: "research-technique"; /** Research tool or instrument */ readonly RESEARCH_TOOL: "research-tool"; /** Software, code, or computer program */ readonly SOFTWARE: "software"; /** Invention disclosure or patent application */ readonly INVENTION: "invention"; /** License or licensing agreement */ readonly LICENSE: "license"; /** Granted patent */ readonly PATENT: "patent"; /** Registered copyright */ readonly REGISTERED_COPYRIGHT: "registered-copyright"; /** Standards document or policy */ readonly STANDARDS_AND_POLICY: "standards-and-policy"; /** Registered trademark */ readonly TRADEMARK: "trademark"; /** Lecture or teaching presentation */ readonly LECTURE_SPEECH: "lecture-speech"; /** Educational resource or learning material */ readonly LEARNING_OBJECT: "learning-object"; /** Publication by a supervised student */ readonly SUPERVISED_STUDENT_PUBLICATION: "supervised-student-publication"; /** Uncategorized or miscellaneous work */ readonly OTHER: "other"; /** Unsupported or unrecognized work type */ readonly UNSUPPORTED: "unsupported"; /** @deprecated Replaced by {@link CONFERENCE_OUTPUT} */ readonly CONFERENCE_ABSTRACT: "conference-abstract"; /** @deprecated Legacy disclosure type */ readonly DISCLOSURE: "disclosure"; /** @deprecated Replaced by {@link BOOK} */ readonly EDITED_BOOK: "edited-book"; /** @deprecated Replaced by {@link LEARNING_OBJECT} */ readonly MANUAL: "manual"; /** @deprecated Replaced by {@link MAGAZINE_ARTICLE} or {@link NEWSPAPER_ARTICLE} */ readonly NEWSLETTER_ARTICLE: "newsletter-article"; /** @deprecated Legacy spin-off company type */ readonly SPIN_OFF_COMPANY: "spin-off-company"; /** @deprecated Replaced by {@link REPORT} */ readonly TECHNICAL_STANDARDS: "technical-standards"; /** @deprecated Replaced by {@link LEARNING_OBJECT} */ readonly TEST: "test"; }; /** * Union type of all valid ORCID work type string values. * * @remarks * This type is derived from the {@link WORK_TYPES} constant object and includes * all possible work type string values (e.g., 'journal-article', 'book', etc.). * * @example * ```ts * function processWork(type: WorkType) { * switch (type) { * case WORK_TYPES.ARTICLE: * console.log('Processing journal article'); * break; * case WORK_TYPES.BOOK: * console.log('Processing book'); * break; * // ... handle other types * } * } * ``` */ export type WorkType = typeof WORK_TYPES[keyof typeof WORK_TYPES]; /** * Utility namespace for WorkType operations. * * Note: This uses TypeScript's namespace pattern to attach utility functions * to the type itself, allowing usage like `WorkType.format()`. */ export declare namespace WorkType { /** * Formats a work type constant into a human-readable string like in the ORCID user interface. * * @param workType - The work type constant to format * @returns Formatted string * * @remarks * This function converts hyphenated work type strings into space-separated, * title-case strings suitable for user interfaces. * * @example * ```ts * WorkType.format(WORK_TYPES.ARTICLE); * // Returns: "Journal article" * * WorkType.format(WORK_TYPES.CONFERENCE_PAPER); * // Returns: "Conference paper" * ``` */ function format(workType: WorkType): string; /** * Parses a string into a valid WorkType constant. * * @param str - Input string to parse (case-insensitive, whitespace-flexible) * @returns Corresponding WorkType constant, or {@link WORK_TYPES.UNSUPPORTED} if not found * * @remarks * This function attempts to match the input string in multiple ways: * 1. First tries to match against WORK_TYPES constant names (e.g., "JOURNAL_ARTICLE") * 2. Falls back to matching against actual type values (e.g., "journal-article") * 3. Returns {@link WORK_TYPES.UNSUPPORTED} if no match is found * * The matching is case-insensitive and handles various whitespace formats. * * @example * ```ts * // From constant name (case-insensitive) * WorkType.fromString('ARTICLE'); * // Returns: 'journal-article' * * WorkType.fromString('conference paper'); * // Returns: 'conference-paper' * * // From actual type value * WorkType.fromString('journal-article'); * // Returns: 'journal-article' * * // Unknown types * WorkType.fromString('unknown-type'); * // Returns: 'unsupported' * * // Flexible whitespace handling * WorkType.fromString(' JOURNAL ARTICLE '); * // Returns: 'journal-article' * ``` */ function fromString(str: string): WorkType; }