import * as rxjs from 'rxjs'; import * as i0 from '@angular/core'; import { OnInit } from '@angular/core'; import { SafeHtml } from '@angular/platform-browser'; import * as io from 'io-ts'; import * as iot from 'io-ts-types'; type HighlightJsTheme = 'a11y-dark' | 'a11y-light' | 'agate' | 'androidstudio' | 'an-old-hope' | 'arduino-light' | 'arta' | 'ascetic' | 'atom-one-dark' | 'atom-one-dark-reasonable' | 'atom-one-light' | 'brown-paper' | 'codepen-embed' | 'color-brewer' | 'dark' | 'default' | 'devibeans' | 'docco' | 'far' | 'felipec' | 'foundation' | 'github' | 'github-dark' | 'github-dark-dimmed' | 'gml' | 'googlecode' | 'gradient-dark' | 'gradient-light' | 'grayscale' | 'hybrid' | 'idea' | 'intellij-light' | 'ir-black' | 'isbl-editor-dark' | 'isbl-editor-light' | 'kimbie-dark' | 'kimbie-light' | 'lightfair' | 'lioshi' | 'magula' | 'mono-blue' | 'monokai' | 'monokai-sublime' | 'night-owl' | 'nnfx-dark' | 'nnfx-light' | 'nord' | 'obsidian' | 'panda-syntax-dark' | 'panda-syntax-light' | 'paraiso-dark' | 'paraiso-light' | 'pojoaque' | 'purebasic' | 'qtcreator-dark' | 'qtcreator-light' | 'rainbow' | 'routeros' | 'school-book' | 'shades-of-purple' | 'srcery' | 'stackoverflow-dark' | 'stackoverflow-light' | 'sunburst' | 'tokyo-night-dark' | 'tokyo-night-light' | 'tomorrow-night-blue' | 'tomorrow-night-bright' | 'vs' | 'vs2015' | 'xcode' | 'xt256'; declare class NgxGist implements Gist { constructor(args: Gist & Pick); /** Core gist properties */ readonly comments: number; readonly comments_url: string; readonly commits_url: string; readonly created_at: Date; readonly description: string; readonly files: io.TypeOf; readonly forks: unknown[]; readonly forks_url: string; readonly git_pull_url: string; readonly git_push_url: string; readonly history: Array>; readonly html_url: string; readonly id: string; readonly node_id: string; readonly owner?: io.TypeOf; readonly public: boolean; readonly truncated: boolean; readonly updated_at: Date; readonly url: string; readonly user?: unknown; /** Additional properties */ readonly highlightedFiles: HighlightedFiles; readonly languageOverride?: string; /** * Create a local, static gist object. Do not use this for fetched data. * Used for creating and displaying local code samples. * * Use `deserialize` sibling function for remote "unknown" responses. * * @param args Minimally necessary paramaters for displaying local code. * @returns A 'partial' model in which unnecessary fields are dummny data. */ static create(args: { files: Files; } & Partial> & // Required // Optional Pick): NgxGist; /** * Deserialize and decode fetched/unknown data into the full model. * * @param value Unknown value, but expects a full model either by object or JSON string. * @returns Either the full model or null if deserialization fails. */ static deserialize(value: unknown): NgxGist | null; } type Files = Array>; type HighlightedFiles = Array; interface HighlightedContent { highlightedContent: string; } declare const gitHubUserCodec: io.ReadonlyC>; declare const gistHistoryCodec: io.ReadonlyC>; committed_at: io.UnionC<[iot.DateC, io.StringC]>; url: io.StringC; user: io.ReadonlyC>; version: io.StringC; }>>; declare const gistFilesContent: io.TypeC<{ content: io.StringC; filename: io.StringC; language: io.StringC; raw_url: io.StringC; size: io.NumberC; truncated: io.BooleanC; type: io.StringC; }>; type GistFilesContent = io.TypeOf; declare const gistFilesCodec: io.RecordC>; declare const gistCodec: io.ReadonlyC; description: io.StringC; files: io.RecordC>; forks: io.UnknownArrayC; forks_url: io.StringC; git_pull_url: io.StringC; git_push_url: io.StringC; history: io.ArrayC>; committed_at: io.UnionC<[iot.DateC, io.StringC]>; url: io.StringC; user: io.ReadonlyC>; version: io.StringC; }>>>; html_url: io.StringC; id: io.StringC; node_id: io.StringC; public: io.BooleanC; truncated: io.BooleanC; updated_at: io.UnionC<[iot.DateC, io.StringC]>; url: io.StringC; }>, io.PartialC<{ owner: io.UnionC<[io.ReadonlyC>, io.UndefinedC]>; user: io.UnionC<[io.UnknownC, io.NullC, io.UndefinedC]>; }>]>>; /** * Official Gist object * https://docs.github.com/en/rest/gists */ type Gist = io.TypeOf; declare class NgxGistComponent implements OnInit { private readonly document; private readonly domSanitizer; private readonly ngxGistLineNumbersService; private readonly ngxGistService; private readonly ngxGistThemeService; /** * Display in the DOM only the selected filename(s) from the gists files array. * * Default: `undefined` * * Example: `'my-styles.scss'` or `'super-feature.ts'` * * Tip: Can be either a string or string array. File names much match exactly, * be sure to remove any leading or trailing whitespace in the provided strings. */ displayOnlyFileNames?: string | readonly string[]; /** * Optionally hide the gist link which opens the gist on GitHub. The gist links * automatically dispaly for remote gists, but can be hidden with this feature. * * Default: `false` */ hideGistLink: boolean; /** * Provide a static gist model here directly which will be displayed if * no `gistId` is provided for remote fetching. Also this model will be * displayed should a fetch fail when retrieving `gistId`, or overwritten * once the pertaining `gistId` data is fetched. * * Default: `undefined` */ set gist(value: NgxGist | undefined); private readonly gistSubject; readonly gistChanges: rxjs.Observable; /** * Provide the GitHub gist id to be fetched and loaded. This can be found in * URL of the gists you create. For example the id `TH1515th31DT0C0PY` in: * https://gist.github.com/FakeUserName/TH1515th31DT0C0PY * * Default: `undefined` * * Tip: Alternatively, provide a value directly in the sibling input `gist`. */ set gistId(value: string); private readonly gistIdSubject; readonly gistIdChanges: rxjs.Observable; /** * The `highlight.js` code theme to use and display. * * Default: `undefined` * * Note: Only _one_ theme can be loaded on a single page at a time! The first * theme to load will apply to all gists on the page. */ codeTheme?: HighlightJsTheme; /** * Display or hide the line numbers in your gist code snippets. * * Default: `true` */ showLineNumbers: boolean; /** * Cache the GitHub gist request in local memory for 24 hours. GitHub has a * request limit, so this helps in reducing bandwidth. Loads previously * fetched gist content from the users machine on refresh and page re-visits. * * Default: `true` */ useCache: boolean; ngOnInit(): Promise; private fetchAndSetGist; private setHljsTheme; applyLineNumbers(highlightedConent: string): SafeHtml | null; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } export { NgxGist, NgxGistComponent, gistCodec }; export type { HighlightJsTheme };