From 98169480bc7b4dd3c1ea991f7ff930b31366b46b Mon Sep 17 00:00:00 2001 From: Kaspar Etter Date: Wed, 15 Jan 2020 09:21:22 +0100 Subject: [PATCH] anchor-js: fix and update anchor options (#41544) https://www.bryanbraun.com/anchorjs/#options https://github.com/bryanbraun/anchorjs/releases/tag/4.2.0 --- types/anchor-js/anchor-js-tests.ts | 9 +++++++++ types/anchor-js/index.d.ts | 8 +++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/types/anchor-js/anchor-js-tests.ts b/types/anchor-js/anchor-js-tests.ts index a27e09605a..c41b375cfd 100644 --- a/types/anchor-js/anchor-js-tests.ts +++ b/types/anchor-js/anchor-js-tests.ts @@ -14,3 +14,12 @@ const footerAnchors = new AnchorJS({ placement: 'right', }); footerAnchors.remove('.links'); + +anchors.options = { + placement: 'left', + visible: 'always', + icon: 'ΒΆ' +}; + +anchors.options.base = '/2019/1/03/my-post'; +anchors.options.titleText = 'Click to directly link to this section.'; diff --git a/types/anchor-js/index.d.ts b/types/anchor-js/index.d.ts index 1f59c295e2..04d8a037fb 100644 --- a/types/anchor-js/index.d.ts +++ b/types/anchor-js/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for anchor-js 4.1 +// Type definitions for anchor-js 4.2 // Project: https://github.com/bryanbraun/anchorjs // Definitions by: Brian Surowiec // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -16,10 +16,12 @@ declare namespace anchorjs { type AnchorVisibility = 'always' | 'hover' | 'touch'; interface AnchorOptions { - arialabel?: string; + ariaLabel?: string; + base?: string; class?: string; - icons?: string; + icon?: string; placement?: AnchorPlacement; + titleText?: string; truncate?: number; visible?: AnchorVisibility; }