UNPKG

ashish-sdk

Version:
37 lines (36 loc) 1.42 kB
/** * Copyright (c) 2022 * * Common utility functions for ThoughtSpot Visual Embed SDK * * @summary Utils * @author Ayon Ghosh <ayon.ghosh@thoughtspot.com> */ import { QueryParams, RuntimeFilter } from './types'; /** * Construct a runtime filters query string from the given filters. * Refer to the following docs for more details on runtime filter syntax: * https://cloud-docs.thoughtspot.com/admin/ts-cloud/apply-runtime-filter.html * https://cloud-docs.thoughtspot.com/admin/ts-cloud/runtime-filter-operators.html * @param runtimeFilters */ export declare const getFilterQuery: (runtimeFilters: RuntimeFilter[]) => string; /** * Return a query param string composed from the given params object * @param queryParams */ export declare const getQueryParamString: (queryParams: QueryParams, shouldSerializeParamValues?: boolean) => string; /** * Get a string representation of a dimension value in CSS * If numeric, it is considered in pixels. * @param value */ export declare const getCssDimension: (value: number | string) => string; /** * Append a string to a URL's hash fragment * @param url A URL * @param stringToAppend The string to append to the URL hash */ export declare const appendToUrlHash: (url: string, stringToAppend: string) => string; export declare const getEncodedQueryParamsString: (queryString: string) => string; export declare const getOffsetTop: (element: any) => any;