Commit 6f3a741d authored by Alejandro Celaya's avatar Alejandro Celaya Committed by Alejandro Celaya

Migrate service-config module to TS

parent bce4c251
......@@ -13,7 +13,7 @@ import { hostPageConfig } from './host-config';
/**
* Ascend `levels` from `window_` to find the designated embedder frame.
*
* @param levels - Number of ancestors levels to ascend
* @param levels - Number of ancestor levels to ascend
*/
function getEmbedderFrame(levels: number, window_: Window = window): Window {
let ancestorWindow = window_;
......
/**
* @typedef {import('../../types/config').SidebarSettings} SidebarSettings
* @typedef {import('../../types/config').Service} Service
*/
import type { SidebarSettings, Service } from '../../types/config';
/**
* Return the configuration for the annotation service which the client would retrieve
* annotations from which may contain the authority, grantToken and icon.
*
* @param {SidebarSettings} settings
* @return {Service|null}
*/
export function serviceConfig({ services }) {
export function serviceConfig({ services }: SidebarSettings): Service | null {
if (Array.isArray(services) && services[0]) {
return services[0];
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment