UNPKG

ngx-metafrenzy

Version:

Angular 13 module for setting head tags such as title, meta, and link.

58 lines (57 loc) 2.03 kB
import { RendererFactory2 } from '@angular/core'; import { Meta, Title } from '@angular/platform-browser'; import * as i0 from "@angular/core"; export interface LinkDefinition { charset?: string; crossorigin?: string; href?: string; hreflang?: string; media?: string; rel?: string; rev?: string; sizes?: string; target?: string; type?: string; [prop: string]: string | undefined; } export interface OpenGraph { title?: string; description?: string; type?: string; url?: string; image?: string; site_name?: string; [prop: string]: string | undefined; } export interface Tags { title?: string; description?: string; url?: string; robots?: Robots; image?: string; } export declare type Robots = 'index,follow' | 'index,nofollow' | 'noindex,nofollow' | 'noindex,follow' | 'index, follow' | 'index, nofollow' | 'noindex, nofollow' | 'noindex, follow'; export declare class MetafrenzyService { private readonly title; private readonly meta; private readonly rendererFactory; private document; constructor(title: Title, meta: Meta, rendererFactory: RendererFactory2, document: any); setTitle(title: string): void; getTitle(): string; setMetaTag(name: string, content: string): void; getMetaTag(selector: string, returnElement?: boolean): string | HTMLMetaElement; removeMetaTag(selector: string | HTMLMetaElement): void; setMetaCharsetTag(value: string): void; removeLinkTags(shouldRemoveLinkTagCb: (linkTag: HTMLLinkElement) => boolean): void; setLinkTag(tag: LinkDefinition): void; setAllTitleTags(title: string): void; setAllDescriptionTags(description: string): void; setCanonical(href: string): void; removeCanonical(): void; setRobots(content: Robots): void; setOpenGraph(og: OpenGraph): void; setTags(tags: Tags): void; static ɵfac: i0.ɵɵFactoryDeclaration<MetafrenzyService, never>; static ɵprov: i0.ɵɵInjectableDeclaration<MetafrenzyService>; }