/** * [[include:src/codecs/csl/README.md]] * * @module codecs/csl */ import schema from '@stencila/schema'; import Csl from 'csl-json'; import * as vfile from '../../util/vfile'; import { Codec, CommonDecodeOptions, CommonEncodeOptions } from '../types'; /** * The directory where styles are stored */ export declare const stylesDir: string; export declare class CSLCodec extends Codec implements Codec { readonly mediaTypes: string[]; readonly extNames: string[]; /** * Decode CSL-JSON, or other bibliographic format, to a `Node`. */ readonly decode: (file: vfile.VFile, options?: CommonDecodeOptions) => Promise; /** * Encode a `Node` to CSL-JSON or other bibliographic format * * See https://citation.js.org/api/tutorial-output_options.html * for formats and other options which could be used. */ readonly encode: (node: schema.Node, options?: CommonEncodeOptions) => Promise; } /** * Encode a `CreativeWork` as `Csl.Data`. * * This function is intended as a base for other functions that encode particular * types of creative works e.g. `Book`, or as a fallback. */ export declare const encodeCreativeWork: (work: schema.CreativeWork, type: Csl.ItemType, format: string) => Csl.Data; /** * Encode an `Article` as `Csl.Data` */ export declare const encodeArticle: (article: schema.Article, format: string) => Csl.Data; /** * Encode a `CreativeWork` as `Csl.Data` */ export declare const encodeCsl: (work: schema.CreativeWork, format: string) => Csl.Data; /** * Decode `Csl.Data` to a `CreativeWork` or derived type. */ export declare function decodeCsl(csl: Csl.Data): Promise;