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'; ...@@ -13,7 +13,7 @@ import { hostPageConfig } from './host-config';
/** /**
* Ascend `levels` from `window_` to find the designated embedder frame. * 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 { function getEmbedderFrame(levels: number, window_: Window = window): Window {
let ancestorWindow = window_; let ancestorWindow = window_;
......
/** import type { SidebarSettings, Service } from '../../types/config';
* @typedef {import('../../types/config').SidebarSettings} SidebarSettings
* @typedef {import('../../types/config').Service} Service
*/
/** /**
* Return the configuration for the annotation service which the client would retrieve * Return the configuration for the annotation service which the client would retrieve
* annotations from which may contain the authority, grantToken and icon. * 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]) { if (Array.isArray(services) && services[0]) {
return 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