repo_name
stringlengths
5
122
path
stringlengths
3
232
text
stringlengths
6
1.05M
zhaosiwen1949/malagu
packages/core/src/node/context.ts
import * as requestContext from 'express-http-context'; import { WebSocketChannel, Channel } from '../common'; import ws = require('ws'); import { Dispatcher } from './dispatcher'; import { Session } from './session/session-protocol'; import { Cookies } from './cookies'; import { Request, Response } from './http/http-p...
zhaosiwen1949/malagu
dev-packages/cli/src/webpack/config/base-config-factory.ts
import * as webpack from 'webpack'; import { CliContext } from '../../context'; import * as path from 'path'; const nodePathList = (process.env.NODE_PATH || '') .split(process.platform === 'win32' ? ';' : ':') .filter(p => !!p); export class BaseConfigFactory { create(context: CliContext): webpack.Config...
zhaosiwen1949/malagu
packages/security/src/node/access/policy-factory.ts
import { Policy, ElPoliy, PolicyFactory, SECURITY_EXPRESSION_CONTEXT_KEY } from './access-protocol'; import { Component } from '@malagu/core'; import { Context } from '@malagu/core/lib/node'; @Component(PolicyFactory) export class ElPolicyFactory implements PolicyFactory { async create(options: any): Promise<Polic...
taroosg/nest_test
src/entities/memo.entity.ts
<filename>src/entities/memo.entity.ts import { Entity, Column, PrimaryGeneratedColumn } from 'typeorm'; // ↓これをつけるとEntityクラスになり,memoテーブルの定義になる. @Entity() export class Memo { // auto incrementになる @PrimaryGeneratedColumn() id: number; // ↓カラムの指定 @Column({ length: 500 }) name: string; // ↓カラムの指定 @Column(...
taroosg/nest_test
src/memo/memo.service.ts
import { Injectable } from '@nestjs/common'; import { Memo } from 'src/entities/memo.entity'; //追加! import { Repository } from 'typeorm'; //追加! import { InjectRepository } from '@nestjs/typeorm'; //追加! @Injectable() export class MemoService { constructor( @InjectRepository(Memo) //追加! private readonly memoRe...
taroosg/nest_test
src/memo/memo.controller.ts
import { Controller, Get, Post, Query } from '@nestjs/common'; import { MemoService } from './memo.service'; @Controller('memo') export class MemoController { constructor(private readonly service: MemoService) { } // GetリクエストでサービスのgetMemoListを呼び出す @Get() getMemoList() { return this.service.getMemoList(); ...
nventuro/proxy-explorer
src/components/NavBar/index.tsx
import React from 'react'; import './index.css'; export default function() { return ( <ul className='NavBar'> <li><NavBarLink url='' text='Proxies' /></li> <li><NavBarLink url='https://github.com/OpenZeppelin/proxy-explorer' text='GitHub' /></li> </ul> ); } type NavBarLinkProps = { url: string...
nventuro/proxy-explorer
src/components/AddressSelector/index.tsx
import React, { useState, useContext } from 'react'; import { DispatchContext, Web3Context } from '../../contexts'; import '../styles/Selector.css'; type AddressSelectorProps = { defaultAddress: string }; export default function ({ defaultAddress }: AddressSelectorProps) { const [ errorMessage, setErrorMessage ] = u...
nventuro/proxy-explorer
src/components/NetworkSelector/index.tsx
import React, { useContext } from 'react'; import { DispatchContext } from '../../contexts'; import '../styles/Selector.css'; import { networks, NetworkId } from '../../networks'; type NetworkSelectorProps = { defaultNetwork: NetworkId }; export default function ({ defaultNetwork }: NetworkSelectorProps) { const di...
nventuro/proxy-explorer
src/App.tsx
import './App.css'; import React, { useReducer } from 'react'; import { useWeb3Network } from '@openzeppelin/network/react'; import { DispatchContext, Web3Context } from './contexts'; import { Action } from './actions'; import { Network, networks } from './networks'; import NavBar from './components/NavBar'; import ...
nventuro/proxy-explorer
src/networks.ts
<filename>src/networks.ts<gh_stars>1-10 const INFURA_PROJECT_ID = 'c3422181d0594697a38defe7706a1e5b'; export type NetworkId = | 'mainnet' | 'ropsten' | 'rinkeby' | 'kovan' | 'goerli' | 'polygon' | 'binance'; export type Network = { name: string; query: string; explorer: string; }; export const ne...
nventuro/proxy-explorer
src/components/Footer/index.tsx
<filename>src/components/Footer/index.tsx import React from 'react'; import './index.css'; export default function() { return ( <div className='Footer'> <a target='_blank' rel='noopener noreferrer' href='https://github.com/OpenZeppelin/proxy-explorer/issues/new'>Report a bug</a> </div> ); }
nventuro/proxy-explorer
src/contexts.ts
<reponame>nventuro/proxy-explorer import { Dispatch, createContext } from 'react'; import { Action } from './actions'; import Web3 from 'web3'; export const Web3Context = createContext<Web3 | null>(null); export const DispatchContext = createContext<Dispatch<Action> | null>(null);
nventuro/proxy-explorer
src/components/ProxyView/index.tsx
import React from 'react'; import { Network } from '../../networks'; import './index.css'; import { Proxy } from '../../proxy-inspector'; type ProxyViewProps = { proxy: Proxy, network: Network }; export default function ({ proxy, network }: ProxyViewProps) { return ( <div className='ProxyView'> <ProxyVi...
nventuro/proxy-explorer
src/actions.ts
import { Network } from './networks'; type ChangeAddressAction = { type: 'changeAddress', value: string | null }; type ChangeNetworkAction = { type: 'changeNetwork', value: Network }; export type Action = | ChangeAddressAction | ChangeNetworkAction;
nventuro/proxy-explorer
src/proxy-inspector.ts
<gh_stars>1-10 import Web3 from 'web3'; enum ProxyType { EIP1967, EIP1967ZOS, } type ProxyEIP1967 = { type: ProxyType.EIP1967, implementation: string, admin: string }; type ProxyEIP1967ZOS = { type: ProxyType.EIP1967ZOS, implementation: string, admin: string }; export type Proxy = | ProxyEIP1967 | ProxyEIP19...
nventuro/proxy-explorer
src/components/ProxyLoader/index.tsx
import React, { useState, useEffect, useContext } from 'react'; import { Web3Context } from '../../contexts'; import { Network } from '../../networks'; import { analyze, Proxy } from '../../proxy-inspector'; import ProxyView from '../ProxyView'; import './index.css'; type ProxyLoaderProps = { address: string, networ...
komura-c/supabase
studio/components/layouts/SettingsLayout/SettingsMenu.utils.ts
<gh_stars>0 import { LOG_TYPE_LABEL_MAPPING } from 'components/interfaces/Settings/Logs' import { ProductMenuGroup } from 'components/ui/ProductMenu/ProductMenu.types' export const generateSettingsMenu = (ref: string): ProductMenuGroup[] => { const logTypes: string[] = ['database', 'api'] return [ { tit...
komura-c/supabase
studio/components/interfaces/Settings/Logs/LogEventChart.tsx
<reponame>komura-c/supabase<gh_stars>1-10 import { BarChart } from 'components/to-be-cleaned/Charts/ChartRenderer' import dayjs from 'dayjs' import { LogData } from '.' import utc from 'dayjs/plugin/utc' import { useMemo } from 'react' dayjs.extend(utc) interface Props { data?: LogData[] onBarClick: (timestamp: num...
komura-c/supabase
studio/components/layouts/ProjectLayout/LayoutHeader/FeedbackDropdown/FeedbackDropdown.tsx
<gh_stars>0 import { useState } from 'react' import { Transition } from '@headlessui/react' import { Button, IconMessageCircle } from '@supabase/ui' import { clickOutsideListener } from 'hooks' import FeedbackWidget from './FeedbackWidget' const FeedbackDropdown = () => { const [isOpen, setIsOpen] = useState(false)...
komura-c/supabase
studio/components/layouts/ProjectLayout/ProjectLayout.tsx
<reponame>komura-c/supabase<filename>studio/components/layouts/ProjectLayout/ProjectLayout.tsx import Head from 'next/head' import { FC, ReactNode } from 'react' import { observer } from 'mobx-react-lite' import { isUndefined } from 'lodash' import { useRouter } from 'next/router' import { Project } from 'types' impor...
komura-c/supabase
studio/components/ui/InformationBox.tsx
import { FC, ReactNode, useState } from 'react' import { IconMaximize2, IconMinimize2, Typography } from '@supabase/ui' interface Props { icon?: ReactNode title: ReactNode | string description?: ReactNode | string url?: string urlLabel?: string defaultVisibility?: boolean hideCollapse?: boolean classNa...
komura-c/supabase
studio/tests/fixtures.ts
<gh_stars>1-10 import { LogData } from "components/interfaces/Settings/Logs"; export const logDataFixture = (attrs: Partial<LogData>): LogData => ({ id: `some-uuid-${new Date().getTime()}`, timestamp: new Date().getTime() * 1000, event_message: 'first event', metadata: {}, ...attrs })
komura-c/supabase
studio/components/interfaces/App/PortalToast.tsx
<reponame>komura-c/supabase<filename>studio/components/interfaces/App/PortalToast.tsx import dynamic from 'next/dynamic' import { Toaster, ToastBar, toast } from 'react-hot-toast' import { Button, IconX } from '@supabase/ui' const PortalRootWithNoSSR = dynamic( // @ts-ignore () => import('@radix-ui/react-portal')....
komura-c/supabase
www/components/ImageGrid.tsx
import { useRouter } from 'next/router' import Image from 'next/image' import Link from 'next/link' interface iImages { name: string image: string alt?: string link?: string } type colSizes = 8 | 6 | 4 | 3 type paddingSizes = 6 | 8 | 12 interface iImageGrid { images: iImages[] smCols?: colSizes mdCols?...
komura-c/supabase
examples/remix-auth/app/routes/private.profile.tsx
import type { ActionFunction, LoaderFunction } from 'remix' import { Form, json, useLoaderData } from 'remix' import { authenticator, supabaseStrategy } from '~/auth.server' type LoaderData = { email?: string; id?: string } export const action: ActionFunction = async ({ request }) => { await authenticator.logout(re...
komura-c/supabase
studio/lib/common/fetch/index.ts
export * from './base' export * from './delete' export * from './get' export * from './patch' export * from './post' export * from './head'
komura-c/supabase
studio/lib/constants/infrastructure.ts
// Alias regions remain as the starting point for project creation // they are immediately translated to their respective cloud regions // and are afterward never referred to export const REGIONS = { WEST_US: 'West US (North California)', EAST_US: 'East US (North Virginia)', CENTRAL_CANADA: 'Canada (Central)', ...
komura-c/supabase
studio/components/interfaces/Home/Landing.tsx
<reponame>komura-c/supabase import Image from 'next/image' import Link from 'next/link' import Head from 'next/head' import { observer } from 'mobx-react-lite' import { Button, IconGitHub, Typography } from '@supabase/ui' import { useStore } from 'hooks' import { auth } from 'lib/gotrue' const Landing = () => { con...
komura-c/supabase
studio/components/interfaces/App/GoTrueWrapper/GoTrueWrapper.tsx
import { FC, useEffect, useState } from 'react' import { Subscription } from '@supabase/gotrue-js' import { auth } from 'lib/gotrue' import Connecting from 'components/ui/Loading' import { doesTokenDataExist } from './GoTrueWrapper.utils' /** * On app first load, gotrue client may take a while to refresh access toke...
komura-c/supabase
studio/components/interfaces/Home/ProjectUsage.tsx
<reponame>komura-c/supabase import useSWR from 'swr' import dayjs from 'dayjs' import Link from 'next/link' import { FC, useState } from 'react' import { useRouter } from 'next/router' import { IconArchive, IconDatabase, IconKey, IconZap, Typography, Button, Dropdown, IconChevronDown, } from '@supabase/...
komura-c/supabase
studio/components/to-be-cleaned/DisplayProjectSettings.tsx
<gh_stars>0 import useSWR from 'swr' import { FC } from 'react' import { useRouter } from 'next/router' import { get } from 'lib/common/fetch' import { JwtSecretUpdateStatus, ProjectEvents } from '@supabase/shared-types/out/events' import { IconAlertCircle, Input, Loading, Typography } from '@supabase/ui' import { use...
komura-c/supabase
studio/components/interfaces/App/index.ts
<reponame>komura-c/supabase import PortalToast from './PortalToast' import GoTrueWrapper from './GoTrueWrapper/GoTrueWrapper' import RouteValidationWrapper from './RouteValidationWrapper' export { PortalToast, GoTrueWrapper, RouteValidationWrapper }
komura-c/supabase
www/components/Carousels/SplitCodeBlockCarousel.tsx
import { useState } from 'react' // Import Swiper React components import { Swiper, SwiperSlide } from 'swiper/react' import { Tabs, Typography, Button, Space } from '@supabase/ui' import CodeBlock from '../CodeBlock/CodeBlock' // Import Swiper styles import 'swiper/swiper.min.css' import { Badge } from '@supabase/ui...
komura-c/supabase
studio/hooks/queries/useJwtSecretUpdateStatus.ts
import useSWR from 'swr' import { get } from 'lib/common/fetch' import { JwtSecretUpdateStatus } from '@supabase/shared-types/out/events' import { API_URL } from 'lib/constants' export function useJwtSecretUpdateStatus(projectRef: string | string[] | undefined) { const url = `${API_URL}/props/project/${projectRef}/j...
komura-c/supabase
studio/stores/content/ProjectContentStore.ts
<reponame>komura-c/supabase import { makeAutoObservable } from 'mobx' import { keyBy } from 'lodash' import { get, post, patch, delete_ } from 'lib/common/fetch' import { UserContent, UserContentMap } from 'types' import { IRootStore } from '../RootStore' import { API_URL } from 'lib/constants' // [Joshen] This will ...
komura-c/supabase
studio/components/layouts/SQLEditorLayout/SQLEditorLayout.tsx
<reponame>komura-c/supabase import { FC, ReactNode, useEffect, useState } from 'react' import { observer } from 'mobx-react-lite' import { useStore } from 'hooks' import Error from 'components/ui/Error' import ProjectLayout from '../ProjectLayout/ProjectLayout' // import SQLEditorMenu from './SQLEditorMenu' import SQL...
komura-c/supabase
studio/components/interfaces/Settings/Logs/index.ts
export * from './Logs.types' export * from './Logs.constants' export {default as LogPanel} from "./LogPanel" export {default as LogTable} from "./LogTable" export {default as LogEventChart} from "./LogEventChart"
komura-c/supabase
www/pages/storage/Storage.tsx
<gh_stars>1-10 import { Badge, Button, IconArrowUpRight, IconBarChart, IconCheckSquare, IconShuffle, IconWifi, IconX, Space, Typography, } from '@supabase/ui' import ApiExamples from 'data/products/storage/api-examples' import DashboardViewData from 'data/products/storage/dashboard-carousel.json' im...
komura-c/supabase
studio/pages/api/auth/[ref]/users.ts
import { NextApiRequest, NextApiResponse } from 'next' import SqlString from 'sqlstring' import { post } from 'lib/common/fetch' import { tryParseInt } from 'lib/helpers' import { PG_META_URL } from 'lib/constants' import apiWrapper from 'lib/api/apiWrapper' import { constructHeaders } from 'lib/api/apiHelpers' expor...
komura-c/supabase
studio/components/interfaces/Settings/Logs/Logs.constants.ts
<gh_stars>1-10 import { LogTemplate } from '.' export const TEMPLATES: LogTemplate[] = [ { label: 'Recent Errors', mode: 'simple', searchString: '[Ee]rror|\\s[45][0-9][0-9]\\s', for: ['api'], }, { label: 'Commits', mode: 'simple', searchString: 'COMMIT', for: ['database'], }, ...
komura-c/supabase
studio/hooks/queries/useSubscriptionStats.ts
<filename>studio/hooks/queries/useSubscriptionStats.ts import useSWR, { mutate } from 'swr' import { get } from 'lib/common/fetch' import { API_URL } from 'lib/constants' export interface SubscriptionStats { total_paid_projects: number total_free_projects: number total_pro_projects: number total_payg_projects:...
komura-c/supabase
studio/hooks/misc/withAuth.tsx
import { useProfile, useStore } from 'hooks' import { ComponentType, useEffect, useState } from 'react' import { flatten, isUndefined } from 'lodash' import { NextRouter, useRouter } from 'next/router' import { IS_PLATFORM } from 'lib/constants' import Connecting from 'components/ui/Loading' import { Project } from 'ty...
komura-c/supabase
studio/components/interfaces/App/GoTrueWrapper/GoTrueWrapper.utils.ts
<reponame>komura-c/supabase export function doesTokenDataExist() { // ignore if server-side if (typeof window === 'undefined') return false // check tokenData on localstorage const tokenData = window?.localStorage['supabase.auth.token'] return tokenData != undefined && typeof tokenData === 'string' }
kdhingra307/gapit-htmlgraphics-panel
src/utils/parseJSON.test.ts
<gh_stars>0 import { parseJSON } from 'utils/parseJSON'; describe('parseJSON', () => { describe('dummy dict', () => { beforeEach(() => { jest.spyOn(console, 'error').mockImplementation(); }); afterEach(() => { jest.spyOn(console, 'error').mockRestore(); }); const DUMMY_DICT = { ...
kdhingra307/gapit-htmlgraphics-panel
src/components/CodeEditor/declarations/htmlNode.ts
<reponame>kdhingra307/gapit-htmlgraphics-panel export default ` interface HTMLNode extends ShadowRoot { onpanelupdate: () => void; onpanelwillunmount: () => void; } /** * The HTML node from the HTML/SVG code. * * It's a shadow root https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_shadow_DOM. *...
kdhingra307/gapit-htmlgraphics-panel
src/components/CodeEditor/declarations/subscription.ts
<reponame>kdhingra307/gapit-htmlgraphics-panel export default ` interface SubscriptionLike extends Unsubscribable { unsubscribe(): void; readonly closed: boolean; } declare class Subscription implements SubscriptionLike { /** @nocollapse */ static EMPTY: Subscription; /** * A flag to indicate whether this...
kdhingra307/gapit-htmlgraphics-panel
src/components/CodeEditor/declarations/observable.ts
export default ` interface UnaryFunction<T, R> { (source: T): R; } interface OperatorFunction<T, R> extends UnaryFunction<Observable<T>, Observable<R>> { } interface PromiseLike<T> { /** * Attaches callbacks for the resolution and/or rejection of the Promise. * @param onfulfilled The callback to execute when...
kdhingra307/gapit-htmlgraphics-panel
src/utils/addHtml.ts
<gh_stars>0 import { ErrorObj, HTMLNodeElement, OptionsInterface } from 'types'; import { SVGBaseFix } from './polyfill'; export function addHtml(shadowContainer: HTMLDivElement | null, options: OptionsInterface) { const htmlNode = shadowContainer?.firstElementChild?.shadowRoot as HTMLNodeElement; const errorObj: ...
kdhingra307/gapit-htmlgraphics-panel
src/components/CodeEditor/declarations/index.ts
<reponame>kdhingra307/gapit-htmlgraphics-panel import codeData from './codeData'; import customProperties from './customProperties'; import data from './data'; import dataFrame from './dataFrame'; import dataQuery from './dataQuery'; import dataQueryRequest from './dataQueryRequest'; import eventBus from './eventBus'; ...
kdhingra307/gapit-htmlgraphics-panel
src/components/Errors.tsx
<gh_stars>0 import { Alert } from '@grafana/ui'; import React from 'react'; interface ErrorsProps { errors: { [key: string]: string }; } export const Errors = ({ errors }: ErrorsProps) => ( <div> {Object.entries(errors) .filter(([, value]) => value !== '') .map(([scope, value]) => ( <Alert...
kdhingra307/gapit-htmlgraphics-panel
src/components/CodeEditor/declarations/options.ts
export default ` type EditorCodeType = string | undefined; interface OptionsInterface { add100Percentage: boolean; centerAlignContent: boolean; SVGBaseFix: boolean; rootCSS: EditorCodeType; css: EditorCodeType; html: EditorCodeType; onRender: EditorCodeType; onInit: EditorCodeType; codeData: EditorCo...
kdhingra307/gapit-htmlgraphics-panel
src/utils/polyfill/SVGBaseFix.ts
<filename>src/utils/polyfill/SVGBaseFix.ts /* Fixes references to inline SVG elements when the <base> tag is in use. Firefox can't find the refrenced link in xlink:href For example, when using gradients, the gradients can't be found, which then causes the element to be invisible More info: - https://gist....
kdhingra307/gapit-htmlgraphics-panel
src/components/CodeEditor/declarations/getTemplateSrv.ts
<gh_stars>10-100 export default ` declare type VariableType = | "query" | "adhoc" | "constant" | "datasource" | "interval" | "textbox" | "custom" | "system"; interface VariableModel { type: VariableType; name: string; label: string | null; } /** * Via the TemplateSrv consumers get access to all...
kdhingra307/gapit-htmlgraphics-panel
src/utils/events/panelupdate.ts
import { HTMLNodeElement } from 'types'; export const panelupdateEvent = new CustomEvent('panelupdate'); export function triggerPanelupdate(shadowElt: HTMLDivElement | null) { const htmlNode = shadowElt?.shadowRoot as HTMLNodeElement; if (htmlNode && htmlNode.onpanelupdate) { htmlNode.onpanelupdate(); htm...
kdhingra307/gapit-htmlgraphics-panel
src/utils/readFile.ts
export async function readFile(file: File) { const data = await new Response(file).text(); return data; }
kdhingra307/gapit-htmlgraphics-panel
src/components/CodeEditor/declarations/htmlGraphics.ts
<gh_stars>10-100 export default ` declare const htmlGraphics: { codeData: typeof codeData; customProperties: typeof customProperties; data: typeof data; getLocationSrv: typeof getLocationSrv; getTemplateSrv: typeof getTemplateSrv; htmlNode: typeof htmlNode; options: typeof options; theme: typeof theme; ...
kdhingra307/gapit-htmlgraphics-panel
src/HTMLPanel.tsx
<gh_stars>0 import React, { PureComponent } from 'react'; import { FieldDisplay, fieldReducers, getFieldDisplayValues, GetFieldDisplayValuesOptions, PanelProps, } from '@grafana/data'; import { config, getTemplateSrv, getLocationSrv } from '@grafana/runtime'; import { OptionsInterface, CalcsMutation, ErrorObj...
kdhingra307/gapit-htmlgraphics-panel
src/components/CodeEditor/declarations/fieldReducers.ts
<reponame>kdhingra307/gapit-htmlgraphics-panel export default ` interface SelectableValue<T = any> { label?: string; ariaLabel?: string; value?: T; imgUrl?: string; icon?: string; description?: string; [key: string]: any; } interface RegistrySelectInfo { options: Array<SelectableValue<string>>; curren...
kdhingra307/gapit-htmlgraphics-panel
src/components/SimpleOptions.tsx
<filename>src/components/SimpleOptions.tsx import React from 'react'; import { Switch, Input, ControlledCollapse, Label } from '@grafana/ui'; import { getType } from 'utils/getType'; interface SimpleOptionsProps { dict: { [key: string]: any }; update: Function; } interface SimpleOptionProps extends SimpleOptionsP...
kdhingra307/gapit-htmlgraphics-panel
src/utils/getType.test.ts
<reponame>kdhingra307/gapit-htmlgraphics-panel<gh_stars>10-100 import { getType } from 'utils/getType'; const enum Types { Null = 'Null', Undefined = 'Undefined', Boolean = 'Boolean', String = 'String', Number = 'Number', Array = 'Array', Object = 'Object', } describe('getType', () => { it('returns Nu...
kdhingra307/gapit-htmlgraphics-panel
src/components/CodeEditor/declarations/dataQueryRequest.ts
export default ` declare enum CoreApp { Dashboard = "dashboard", Explore = "explore", } declare enum ExploreMode { Logs = "Logs", Metrics = "Metrics", Tracing = "Tracing", } interface DataQueryRequest<TQuery extends DataQuery = DataQuery> { requestId: string; interval: string; intervalMs: number; ma...
kdhingra307/gapit-htmlgraphics-panel
src/components/CodeEditor/declarations/panelProps.ts
<reponame>kdhingra307/gapit-htmlgraphics-panel export default ` declare type InterpolateFunction = (value: string, scopedVars?: ScopedVars, format?: string | Function) => string; interface FieldConfigSource<TOptions extends object = any> { defaults: FieldConfig<TOptions>; overrides: ConfigOverrideRule[]; } interf...
kdhingra307/gapit-htmlgraphics-panel
src/components/CodeEditor/declarations/dataQuery.ts
<reponame>kdhingra307/gapit-htmlgraphics-panel export default ` interface DataQuery { /** * A - Z */ refId: string; /** * true if query is disabled (ie should not be returned to the dashboard) */ hide?: boolean; /** * Unique, guid like, string used in explore mode */ key?: string; /** ...
kdhingra307/gapit-htmlgraphics-panel
src/components/CodeEditor/declarations/dataFrame.ts
<reponame>kdhingra307/gapit-htmlgraphics-panel export default ` interface QueryResultBase { /** * Matches the query target refId */ refId?: string; /** * Used by some backend data sources to communicate back info about the execution (generated sql, timing) */ meta?: { [key: string]: any }; } declar...
kdhingra307/gapit-htmlgraphics-panel
src/components/CodeEditor/declarations/scopedVars.ts
export default ` interface ScopedVar<T = any> { text: any; value: T; [key: string]: any; } interface ScopedVars { [key: string]: ScopedVar; } `;
kdhingra307/gapit-htmlgraphics-panel
src/components/CodeEditor/index.tsx
import React, { FC } from 'react'; import { editor } from 'monaco-editor/esm/vs/editor/editor.api'; import { EditorLanguageType } from 'types'; import { CodeEditor as GrafanaCodeEditor, Monaco } from '@grafana/ui'; interface Props { language: EditorLanguageType; value: string | undefined; onChange: (value?: stri...
kdhingra307/gapit-htmlgraphics-panel
src/components/CodeEditor/declarations/getFieldDisplayValues.ts
export default ` declare abstract class FunctionalVector<T = any> implements Vector<T>, Iterable<T> { abstract get length(): number; abstract get(index: number): T; iterator(): Generator<T, void, unknown>; [Symbol.iterator](): Generator<T, void, unknown>; forEach(iterator: (row: T) => void): void; map<V>(tr...
kdhingra307/gapit-htmlgraphics-panel
src/components/PanelOptions/SelectedCalcsOption.tsx
import React from 'react'; import { fieldReducers, ReducerID, StandardEditorProps } from '@grafana/data'; import { MultiSelect } from '@grafana/ui'; interface Props extends StandardEditorProps<string[]> {} export const SelectedCalcsOption: React.FC<Props> = ({ value, item, onChange, context }) => { const options = ...
kdhingra307/gapit-htmlgraphics-panel
src/components/PanelOptions/CodeData.tsx
<filename>src/components/PanelOptions/CodeData.tsx<gh_stars>10-100 import React, { useState } from 'react'; import { StandardEditorProps } from '@grafana/data'; import { OptionsInterface, EditorLanguageType, EditorCodeType } from 'types'; import { CodeEditor } from 'components/CodeEditor'; import { Switch, Label } from...
kdhingra307/gapit-htmlgraphics-panel
website/src/components/HomepageFeatures.tsx
<filename>website/src/components/HomepageFeatures.tsx import React from 'react'; import clsx from 'clsx'; import styles from './HomepageFeatures.module.css'; const FeatureList = [ { title: 'Offline', description: <>No need for internet to use any of the plugins functionality.</>, }, { title: 'Creativ...
kdhingra307/gapit-htmlgraphics-panel
src/components/CodeEditor/declarations/textEditorDeclarations.test.ts
<gh_stars>10-100 import textEditorDeclarations from '.'; describe('Code editor declarations', () => { it('is a valid string', () => { expect(textEditorDeclarations).toEqual(expect.any(String)); }); describe('Contains the needed declarations', () => { it('contains execution environment variables', () => {...
kdhingra307/gapit-htmlgraphics-panel
src/utils/events/panelwillunmount.ts
import { HTMLNodeElement } from 'types'; export const panelwillunmountEvent = new CustomEvent('panelwillunmount'); export function triggerPanelwillunmount(shadowElt: HTMLDivElement | null) { const htmlNode = shadowElt?.shadowRoot as HTMLNodeElement; if (htmlNode && htmlNode.onpanelwillunmount) { htmlNode.onpa...
kdhingra307/gapit-htmlgraphics-panel
src/utils/getType.ts
<filename>src/utils/getType.ts /** * Checks the type of value and returns it as a string * This works with all types (null, undefined, object, ETC) * * @param value - Value to check the type of * * @returns the type of the value as a string */ export function getType(value: unknown): string { return Object.pro...
kdhingra307/gapit-htmlgraphics-panel
src/components/CodeEditor/declarations/data.ts
<gh_stars>10-100 export default ` /** * Represent panel data loading state. */ declare enum LoadingState { NotStarted = "NotStarted", Loading = "Loading", Streaming = "Streaming", Done = "Done", Error = "Error", } interface DataQueryTimings { dataProcessingTime: number; } declare enum DataQueryErrorType...
kdhingra307/gapit-htmlgraphics-panel
src/utils/addShadowRoot.ts
<reponame>kdhingra307/gapit-htmlgraphics-panel<gh_stars>0 import { HTMLNodeElement } from 'types'; import { addOnFunctionEvents } from './addOnFunctionEvents'; function getShadowElt({ centerAlignContent = false } = {}) { const shadowElt = document.createElement('div'); shadowElt.attachShadow({ mode: 'open' }); ...
kdhingra307/gapit-htmlgraphics-panel
src/utils/polyfill/index.ts
import { SVGBaseFix } from './SVGBaseFix'; export { SVGBaseFix };
kdhingra307/gapit-htmlgraphics-panel
src/components/CodeEditor/declarations/valueMapping.ts
export default ` declare enum MappingType { ValueToText = 1, RangeToText = 2, } interface BaseMap { id: number; text: string; type: MappingType; } declare type ValueMapping = ValueMap | RangeMap; interface ValueMap extends BaseMap { value: string; } interface RangeMap extends BaseMap { from: string; to:...
kdhingra307/gapit-htmlgraphics-panel
src/components/CodeEditor/declarations/theme2.ts
<reponame>kdhingra307/gapit-htmlgraphics-panel<gh_stars>10-100 export default ` declare type ThemeSpacingOptions = { gridSize?: number; }; /** @internal */ declare type ThemeSpacingArgument = number | string; /** * @beta * The different signatures imply different meaning for their arguments that can't be expressed st...
kdhingra307/gapit-htmlgraphics-panel
src/utils/addOnFunctionEvents.ts
<gh_stars>0 import { HTMLNodeElement } from 'types'; export function addOnFunctionEvents(htmlNode: HTMLNodeElement) { htmlNode.onpanelupdate = () => {}; htmlNode.onpanelwillunmount = () => {}; }
kdhingra307/gapit-htmlgraphics-panel
src/components/CodeEditor/declarations/customProperties.ts
<reponame>kdhingra307/gapit-htmlgraphics-panel export default ` /** * Custom properties as a dictionary. */ declare const customProperties: typeof codeData `;
kdhingra307/gapit-htmlgraphics-panel
src/components/CodeEditor/declarations/timezone.ts
export default ` declare type TimeZoneUtc = 'utc'; declare type TimeZoneBrowser = 'browser'; declare type TimeZone = TimeZoneBrowser | TimeZoneUtc | string; `;
kdhingra307/gapit-htmlgraphics-panel
src/components/CodeEditor/declarations/fieldColor.ts
export default ` declare enum FieldColorMode { Thresholds = "thresholds", Scheme = "scheme", Fixed = "fixed", } interface FieldColor { mode: FieldColorMode; schemeName?: ColorScheme; fixedColor?: string; } declare enum ColorScheme { BrBG = "BrBG", PRGn = "PRGn", PiYG = "PiYG", PuOr = "PuOr", RdBu ...
kdhingra307/gapit-htmlgraphics-panel
src/components/CodeEditor/declarations/eventBus.ts
export default ` interface EventFilterOptions { onlyLocal: boolean; } interface BusEventHandler<T extends BusEvent> { (event: T): void; } interface BusEventType<T extends BusEvent> { type: string; new (...args: any[]): T; } interface BusEvent { readonly type: string; readonly payload?: any; readonly or...
kdhingra307/gapit-htmlgraphics-panel
src/components/PanelOptions/CodeEditor.tsx
import React from 'react'; import { StandardEditorProps } from '@grafana/data'; import { CodeEditor } from 'components/CodeEditor'; import { EditorLanguageType, EditorCodeType } from 'types'; interface Settings { language: EditorLanguageType; } interface Props extends StandardEditorProps<EditorCodeType, Settings> {...
kdhingra307/gapit-htmlgraphics-panel
src/utils/exportFile.ts
<reponame>kdhingra307/gapit-htmlgraphics-panel<gh_stars>10-100 export enum contentType { json = 'application/json;charset=utf-8;', } export function exportFile(string: string, filename: string, contentType: contentType) { const a = document.createElement('a'); a.download = filename; a.href = 'data:' + contentT...
kdhingra307/gapit-htmlgraphics-panel
src/utils/polyfill/SVGBaseFix.test.ts
import { SVGBaseFix } from './SVGBaseFix'; const svgData = ` <svg version="1.1" viewBox="0 0 400 400" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <linearGradient id="linearGradient875"> <stop offset="0"/> <stop stop-opacity="0" offset="1"/> </linearGradient> <line...
kdhingra307/gapit-htmlgraphics-panel
src/components/CodeEditor/declarations/codeData.ts
<filename>src/components/CodeEditor/declarations/codeData.ts export default ` /** * Custom properties as a dictionary. */ declare const codeData: {[key: string]: any}; `;
AmitPrivate93/react-typescript-seed
src/App.tsx
<filename>src/App.tsx import React from "react"; interface PropTypes{ } const App: React.FC<PropTypes> = ({}) => { return <div className="app">React Typescript Seed Project</div>; }; export default App;
shenzhongkang/kda-icons
src/index.tsx
<filename>src/index.tsx<gh_stars>0 import React, { FC } from 'react'; import classnames from 'classnames'; export declare type IconNameType = | 'search' | 'home' | 'settings' | 'done' | 'account_circle' | 'info' | 'delete' | 'shopping_cart' | 'favorite' | 'check_circle' | 'logout' | 'descriptio...
shenzhongkang/kda-icons
stories/Icon.stories.tsx
<gh_stars>0 import React from 'react'; import { Meta, Story } from '@storybook/react'; import { Icon, IconProps, IconNameType } from '../src'; import styled from 'styled-components'; const IconNameArray: IconNameType[] = ['account_circle']; const Container = styled.div` display: grid; grid-template-columns: repea...
temporalio/sdk-typescript
packages/test/src/workflows/throw-big-int.ts
<reponame>temporalio/sdk-typescript<filename>packages/test/src/workflows/throw-big-int.ts export async function throwBigInt(): Promise<void> { throw 42n; }
temporalio/sdk-typescript
packages/common/src/converter/json-payload-converter.ts
<reponame>temporalio/sdk-typescript import { ValueError } from '@temporalio/internal-workflow-common'; import { PayloadConverterWithEncoding } from './payload-converters'; import { encodingKeys, encodingTypes, METADATA_ENCODING_KEY, Payload, str, u8 } from './types'; /** * Converts between non-undefined values and se...
temporalio/sdk-typescript
packages/test/src/workflows/testenv-test-workflows.ts
<reponame>temporalio/sdk-typescript /** * Workflows used in `test-testenvironment.ts` * @module */ import assert from 'assert'; import { sleep, proxyActivities, defineSignal, setHandler } from '@temporalio/workflow'; // Export sleep to be invoked as a workflow export { sleep }; const activities = proxyActivities(...
temporalio/sdk-typescript
packages/common/src/converter/payload-converter.ts
<reponame>temporalio/sdk-typescript import { Payload } from './types'; /** * Used by the framework to serialize/deserialize data like parameters and return values. * * This is called inside the [Workflow isolate](https://docs.temporal.io/typescript/determinism). * To write async code or use Node APIs (or use packa...
temporalio/sdk-typescript
packages/workflow/src/interfaces.ts
import { RetryPolicy, TemporalFailure } from '@temporalio/common'; import { checkExtends, CommonWorkflowOptions, SearchAttributes } from '@temporalio/internal-workflow-common'; import type { coresdk } from '@temporalio/proto'; /** * Workflow Execution information */ export interface WorkflowInfo { /** * ID of t...
temporalio/sdk-typescript
packages/client/src/connection.ts
import * as grpc from '@grpc/grpc-js'; import { filterNullAndUndefined, normalizeTlsConfig, TLSConfig } from '@temporalio/internal-non-workflow-common'; import { AsyncLocalStorage } from 'async_hooks'; import type { RPCImpl } from 'protobufjs'; import { isServerErrorResponse, ServiceError } from './errors'; import { de...
temporalio/sdk-typescript
packages/testing/src/test-service-client.ts
<reponame>temporalio/sdk-typescript<gh_stars>100-1000 import * as grpc from '@grpc/grpc-js'; import { Connection as BaseConnection, ConnectionOptions } from '@temporalio/client'; import { ConnectionCtorOptions as BaseConnectionCtorOptions } from '@temporalio/client/lib/connection'; import { temporal } from '../generate...
temporalio/sdk-typescript
packages/test/src/run-a-workflow.ts
<filename>packages/test/src/run-a-workflow.ts import arg from 'arg'; import { WorkflowClient, Connection } from '@temporalio/client'; import * as workflows from './workflows'; async function main() { const argv = arg({ '--workflow-id': String, }); const [workflowType, ...argsRaw] = argv._; const args = arg...
temporalio/sdk-typescript
packages/test/src/workflows/child-workflow-termination.ts
<gh_stars>100-1000 /** * Tests child workflow termination from the parent workflow perspective * @module */ import { WorkflowExecution } from '@temporalio/common'; import { startChild, defineQuery, setHandler } from '@temporalio/workflow'; import { unblockOrCancel } from './unblock-or-cancel'; export const childEx...