type
stringclasses
7 values
content
stringlengths
4
9.55k
repo
stringlengths
7
96
path
stringlengths
4
178
language
stringclasses
1 value
ArrowFunction
(props: SetupDeleteConfirmationProps) => { const { handleCloseDeletePostConfirmation, handleDeletePost, currentUser, state: { isDeletingPost, postForDeletion } } = props; let deletePostConfirmationProps: DeletePostConfirmationProps | undefined; if (currentUser) { deletePostConfirmationProps = { visible: !!postForDeletion, dismiss: handleCloseDeletePostConfirmation, onDeletePost: handleDeletePost, isLoading: isDeletingPost }; } return { deletePostConfirmationProps }; }
NarrativeCompany/narrative
react-ui/packages/web/src/shared/containers/withDeletePostController.ts
TypeScript
InterfaceDeclaration
interface State { postForDeletion?: Post; isDeletingPost: boolean; }
NarrativeCompany/narrative
react-ui/packages/web/src/shared/containers/withDeletePostController.ts
TypeScript
InterfaceDeclaration
export interface WithOpenDeletePostConfirmationHandler { handleOpenDeletePostConfirmation?: (post: Post) => void; }
NarrativeCompany/narrative
react-ui/packages/web/src/shared/containers/withDeletePostController.ts
TypeScript
InterfaceDeclaration
interface WithCloseDeletePostConfirmationHandler { handleCloseDeletePostConfirmation: () => void; }
NarrativeCompany/narrative
react-ui/packages/web/src/shared/containers/withDeletePostController.ts
TypeScript
InterfaceDeclaration
interface WithDeletePostHandler { handleDeletePost: () => void; }
NarrativeCompany/narrative
react-ui/packages/web/src/shared/containers/withDeletePostController.ts
TypeScript
InterfaceDeclaration
export interface WithPostDeletedHandler { onPostDeleted: () => void; }
NarrativeCompany/narrative
react-ui/packages/web/src/shared/containers/withDeletePostController.ts
TypeScript
InterfaceDeclaration
export interface WithDeletePostControllerProps extends WithOpenDeletePostConfirmationHandler { deletePostConfirmationProps?: DeletePostConfirmationProps; }
NarrativeCompany/narrative
react-ui/packages/web/src/shared/containers/withDeletePostController.ts
TypeScript
TypeAliasDeclaration
type HandleDeletePostProps = WithDeletePostProps & WithStateProps<State> & InjectedIntlProps & WithPostDeletedHandler & WithCurrentUserProps;
NarrativeCompany/narrative
react-ui/packages/web/src/shared/containers/withDeletePostController.ts
TypeScript
TypeAliasDeclaration
type SetupDeleteConfirmationProps = WithStateProps<State> & WithCurrentUserProps & WithDeletePostHandler & WithCloseDeletePostConfirmationHandler;
NarrativeCompany/narrative
react-ui/packages/web/src/shared/containers/withDeletePostController.ts
TypeScript
ArrowFunction
(item: IToolbarItem, index: number) => { if (item.type === 'element') { return <Fragment key={index}>{item.element}</Fragment>; } else if (item.type === 'action') { return ( <ActionButton key={index} {...item.buttonProps} data-testid={item.dataTestid} disabled={item.disabled}> {item.text} </ActionButton>
BruceHaley/BotFramework-Composer
Composer/packages/lib/ui-shared/src/components/Toolbar.tsx
TypeScript
ArrowFunction
(props: ToolbarProps) => { const { toolbarItems = [], ...rest } = props; const left: IToolbarItem[] = []; const right: IToolbarItem[] = []; for (const item of toolbarItems) { switch (item.align) { case 'left': left.push(item); break; case 'right': right.push(item); } } return ( <div aria-label={formatMessage('toolbar')} css={headerSub} role="region" {...rest}> <div css={leftActions}>{left.map(renderItemList)} </div> <div css={rightActions}>{right.map(renderItemList)}</div> </div>
BruceHaley/BotFramework-Composer
Composer/packages/lib/ui-shared/src/components/Toolbar.tsx
TypeScript
TypeAliasDeclaration
// -------------------- IToolbarItem -------------------- // export type IToolbarItem = { type: string; // eslint-disable-next-line @typescript-eslint/no-explicit-any element?: any; text?: string; buttonProps?: { iconProps?: IIconProps; onClick?: () => void; styles?: IButtonStyles; }; menuProps?: IContextualMenuProps; align?: string; dataTestid?: string; disabled?: boolean; };
BruceHaley/BotFramework-Composer
Composer/packages/lib/ui-shared/src/components/Toolbar.tsx
TypeScript
TypeAliasDeclaration
type ToolbarProps = { toolbarItems?: Array<IToolbarItem>; };
BruceHaley/BotFramework-Composer
Composer/packages/lib/ui-shared/src/components/Toolbar.tsx
TypeScript
MethodDeclaration
formatMessage('toolbar')
BruceHaley/BotFramework-Composer
Composer/packages/lib/ui-shared/src/components/Toolbar.tsx
TypeScript
ArrowFunction
() => { return formatDatetime(locale, createdAtISO); }
samchan0221/authgear-server
portal/src/graphql/adminapi/UserDetailSummary.tsx
TypeScript
ArrowFunction
() => { return formatDatetime(locale, lastLoginAtISO); }
samchan0221/authgear-server
portal/src/graphql/adminapi/UserDetailSummary.tsx
TypeScript
InterfaceDeclaration
interface UserDetailSummaryProps { className?: string; userInfo: UserInfo; createdAtISO: string | null; lastLoginAtISO: string | null; }
samchan0221/authgear-server
portal/src/graphql/adminapi/UserDetailSummary.tsx
TypeScript
MethodDeclaration
cn(styles
samchan0221/authgear-server
portal/src/graphql/adminapi/UserDetailSummary.tsx
TypeScript
ArrowFunction
async () => { /** make sure not to do something before the config is ready */ let scullyConfig: ScullyConfig; let err; /** load the config, and use the defaults when there is an error */ try { scullyConfig = await loadConfig; } catch (e) { scullyConfig = scullyDefaults as ScullyConfig; /** store the error */ err = e; } /** do we need to kill something? */ if (process.argv.includes('killServer')) { await httpGetJson(`http://${scullyConfig.hostName}:${scullyConfig.appPort}/killMe`, { suppressErrors: true, }).catch((e) => e); await httpGetJson(`https://${scullyConfig.hostName}:${scullyConfig.appPort}/killMe`, { suppressErrors: true, }).catch((e) => e); logWarn('Sent kill command to server'); process.exit(0); } if (err) { /** exit due to severe error during config parsing */ process.exit(15); } if (hostName) { scullyConfig.hostName = hostName; } await isBuildThere(scullyConfig); if (process.argv.includes('serve')) { await bootServe(scullyConfig); if (openNavigator) { await open(`http${ssl ? 's' : ''}://${scullyConfig.hostName}:${scullyConfig.staticport}/`); } } else { const folder = join(scullyConfig.homeFolder, scullyConfig.distFolder); /** copy in current build artifacts */ await moveDistAngular(folder, scullyConfig.outDir, { removeStaticDist: removeStaticDist, reset: false, }); const isTaken = await isPortTaken(scullyConfig.staticport); if (typeof scullyConfig.hostUrl === 'string') { logWarn(` You are using "${yellow(scullyConfig.hostUrl)}" as server. `); } else { /** server ports already in use? */ if (!isTaken) { startBackgroundServer(scullyConfig); } else { // debug only console.log(`Background servers already running.`); } if (!(await waitForServerToBeAvailable().catch((e) => false))) { logError('Could not connect to server'); process.exit(15); } } if (openNavigator) { await open(`http${ssl ? 's' : ''}://${scullyConfig.hostName}:${scullyConfig.staticport}/`); } if (watch) { watchMode(join(scullyConfig.homeFolder, scullyConfig.distFolder) || join(scullyConfig.homeFolder, './dist/browser')); } else { // console.log('servers available'); await startScully(); if (!isTaken && typeof scullyConfig.hostUrl !== 'string') { // kill serve ports await httpGetJson(`http${ssl ? 's' : ''}://${scullyConfig.hostName}:${scullyConfig.appPort}/killMe`, { suppressErrors: true, }); } /** done, stop the program */ process.exit(0); } } }
beeman/scully
libs/scully/src/scully.ts
TypeScript
ArrowFunction
(e) => e
beeman/scully
libs/scully/src/scully.ts
TypeScript
ArrowFunction
(e) => false
beeman/scully
libs/scully/src/scully.ts
TypeScript
ArrowFunction
() => new Bxios
HugoJF/banco-imobiliario-webapp
resources/js/bxios.ts
TypeScript
ClassDeclaration
export class Bxios { private method: AxiosRequestConfig['method'] = 'get'; private url: string = ''; private headers: { [header: string]: string } = {}; private data: any; private formData: FormData | undefined = undefined; private custom: AxiosRequestConfig = {}; constructor() { this.headers['Accept'] = 'application/json'; } get(...url: (string | any)[]) { this.parseUrl(url); this.method = 'get'; return this; } post(...url: (string | any)[]) { this.parseUrl(url); this.method = 'post'; return this; } patch(...url: (string | any)[]) { this.parseUrl(url); this.method = 'patch'; return this; } delete(...url: (string | any)[]) { this.parseUrl(url); this.method = 'delete'; return this; } body(data: any) { this.setData(data); return this; } setCustom(data: AxiosRequestConfig) { this.custom = data; return this; } setData(data: any) { if (data instanceof FormData) { this.formData = data; } else { this.data = data; } return this; } multipartFormData() { this.headers['Content-Type'] = 'multipart/form-data'; return this; } patchFormDataFix() { // https://github.com/laravel/framework/issues/13457 if (this.formData) { this.formData.append('_method', 'PATCH'); this.method = 'post'; } return this; } send<T>() { return window.axios.request<T>({ method: this.method, url: this.url, data: this.formData ?? this.data, ...this.custom, }) } private parseUrl(url: string | any[]) { if (!Array.isArray(url)) { url = [url]; } url = ['api', ...url]; url = url.join('/'); if (!url.startsWith('/')) { url = '/' + url; } this.url = url; } }
HugoJF/banco-imobiliario-webapp
resources/js/bxios.ts
TypeScript
MethodDeclaration
get(...url: (string | any)[]) { this.parseUrl(url); this.method = 'get'; return this; }
HugoJF/banco-imobiliario-webapp
resources/js/bxios.ts
TypeScript
MethodDeclaration
post(...url: (string | any)[]) { this.parseUrl(url); this.method = 'post'; return this; }
HugoJF/banco-imobiliario-webapp
resources/js/bxios.ts
TypeScript
MethodDeclaration
patch(...url: (string | any)[]) { this.parseUrl(url); this.method = 'patch'; return this; }
HugoJF/banco-imobiliario-webapp
resources/js/bxios.ts
TypeScript
MethodDeclaration
delete(...url: (string | any)[]) { this.parseUrl(url); this.method = 'delete'; return this; }
HugoJF/banco-imobiliario-webapp
resources/js/bxios.ts
TypeScript
MethodDeclaration
body(data: any) { this.setData(data); return this; }
HugoJF/banco-imobiliario-webapp
resources/js/bxios.ts
TypeScript
MethodDeclaration
setCustom(data: AxiosRequestConfig) { this.custom = data; return this; }
HugoJF/banco-imobiliario-webapp
resources/js/bxios.ts
TypeScript
MethodDeclaration
setData(data: any) { if (data instanceof FormData) { this.formData = data; } else { this.data = data; } return this; }
HugoJF/banco-imobiliario-webapp
resources/js/bxios.ts
TypeScript
MethodDeclaration
multipartFormData() { this.headers['Content-Type'] = 'multipart/form-data'; return this; }
HugoJF/banco-imobiliario-webapp
resources/js/bxios.ts
TypeScript
MethodDeclaration
patchFormDataFix() { // https://github.com/laravel/framework/issues/13457 if (this.formData) { this.formData.append('_method', 'PATCH'); this.method = 'post'; } return this; }
HugoJF/banco-imobiliario-webapp
resources/js/bxios.ts
TypeScript
MethodDeclaration
send<T>() { return window.axios.request<T>({ method: this.method, url: this.url, data: this.formData ?? this.data, ...this.custom, }) }
HugoJF/banco-imobiliario-webapp
resources/js/bxios.ts
TypeScript
MethodDeclaration
private parseUrl(url: string | any[]) { if (!Array.isArray(url)) { url = [url]; } url = ['api', ...url]; url = url.join('/'); if (!url.startsWith('/')) { url = '/' + url; } this.url = url; }
HugoJF/banco-imobiliario-webapp
resources/js/bxios.ts
TypeScript
ArrowFunction
(props: Props) => { const { users, userSelected, idUserDelete } = props; const renderPaginationListUsers = ( <> <thead> <tr> <th>Id</th> <th>Nome do Usuário</th> <th>E-mail</th> <th>Data de Cadastro</th> </tr> </thead> <tbody> {users.map(user => ( <tr className="table-item" key={user.id}> <td> {user.id} </td> <td> {user.name} </td> <td> {user.email} </td> <td> {' '} {format(parseISO(user.createdAt as string), 'dd/MM/yyyy')}{' '} </td> <td className="container-edit-delete"> <OverlayTrigger overlay={<Tooltip id="edit-user">Editar usuário</Tooltip>} > <a className="edit-button" onClick={()
victorgorgonho/whitelabel-management-software-frontend
src/components/ListUsers/index.tsx
TypeScript
ArrowFunction
user => ( <tr className="table-item"
victorgorgonho/whitelabel-management-software-frontend
src/components/ListUsers/index.tsx
TypeScript
InterfaceDeclaration
interface Props { users: User[]; userSelected(user: User): any; idUserDelete(id: string | undefined): any; }
victorgorgonho/whitelabel-management-software-frontend
src/components/ListUsers/index.tsx
TypeScript
MethodDeclaration
format(parseISO
victorgorgonho/whitelabel-management-software-frontend
src/components/ListUsers/index.tsx
TypeScript
ArrowFunction
({ label, message, color = "orange", title, url, }: ShieldProps) => { const Wrapper = url ? (p: AnchorProps) => ( <a {...p} href={url} title={title} target="_blank" rel="noopener noreferrer" />
LaudateCorpus1/doc-blocks
components/Shield/src/index.tsx
TypeScript
ArrowFunction
(p: AnchorProps) => ( <a {...p}
LaudateCorpus1/doc-blocks
components/Shield/src/index.tsx
TypeScript
InterfaceDeclaration
interface ShieldProps { /** The current label */ label?: string; /** The current message */ message?: string; /** The color behind the message */ color?: string; /** A link to open when the shield is clicked */ url?: string; /** A title for the link */ title?: string; }
LaudateCorpus1/doc-blocks
components/Shield/src/index.tsx
TypeScript
TypeAliasDeclaration
type AnchorProps = JSX.LibraryManagedAttributes< "a", React.ComponentPropsWithoutRef<"a"> >;
LaudateCorpus1/doc-blocks
components/Shield/src/index.tsx
TypeScript
ArrowFunction
() => { it('should deep clone objects', () => { const a: Transaction = { id: `this-is-a`, name: `Object A`, email: `[email protected]`, age: 12, phone: `1234512345`, connectionInfo: { type: `object::a`, confidence: 1, }, geoInfo: { latitude: 1, longitude: 2, }, } // Do a deep clone to create b, now try to modify b const b: Transaction = deepClone(a) expect(b!.connectionInfo!.type).toEqual(b!.connectionInfo!.type) b!.connectionInfo!.type = `object::b` expect(a!.connectionInfo!.type).not.toEqual(b!.connectionInfo!.type) }) }
abey-alex/riskie
helpers/object.test.ts
TypeScript
ArrowFunction
() => { const a: Transaction = { id: `this-is-a`, name: `Object A`, email: `[email protected]`, age: 12, phone: `1234512345`, connectionInfo: { type: `object::a`, confidence: 1, }, geoInfo: { latitude: 1, longitude: 2, }, } // Do a deep clone to create b, now try to modify b const b: Transaction = deepClone(a) expect(b!.connectionInfo!.type).toEqual(b!.connectionInfo!.type) b!.connectionInfo!.type = `object::b` expect(a!.connectionInfo!.type).not.toEqual(b!.connectionInfo!.type) }
abey-alex/riskie
helpers/object.test.ts
TypeScript
EnumDeclaration
export enum ProjectTopicTitle { Overview = 'Overview', Problem = 'Problem', TargetMarket = 'Target Market', Benefits = 'Benefit to Network & Community', CenteredAroundTNB = 'Centered around TNB', EstimatedCompletionDate = 'Estimated completion date', }
ChandanNats/Website-2
src/types/projects.ts
TypeScript
EnumDeclaration
export enum ProjectTopicAnchor { Overview = 'topic-overview', Problem = 'topic-problem', TargetMarket = 'topic-target-market', Benefits = 'topic-benefits', CenteredAroundTNB = 'topic-centered-around-tnb', EstimatedCompletionDate = 'topic-completion-date', }
ChandanNats/Website-2
src/types/projects.ts
TypeScript
TypeAliasDeclaration
export type Project = { pk: string; created_date: string; modified_date: string; title: string; description: string; logo: string; github_url: string; overview: string; problem: string; target_market: string; benefits: string; centered_around_tnb: string; estimated_completion_date: string; project_lead: string; project_lead_display_name: string; milestones: Milestone[]; is_featured: boolean; };
ChandanNats/Website-2
src/types/projects.ts
TypeScript
TypeAliasDeclaration
export type Milestone = { uuid: string; created_date: string; modified_date: string; number: number; description: string; project: string; };
ChandanNats/Website-2
src/types/projects.ts
TypeScript
TypeAliasDeclaration
export type ProjectTopicMap = { [key: string]: ProjectTopic; };
ChandanNats/Website-2
src/types/projects.ts
TypeScript
TypeAliasDeclaration
export type ProjectTopic = { anchor: ProjectTopicAnchor; position: number; title: ProjectTopicTitle; };
ChandanNats/Website-2
src/types/projects.ts
TypeScript
ArrowFunction
(block: IBlock) => <p>{blockToText(block)}</p>, [BLOCKS.HEADING1]
piotrzaborow/notion-blocks-react-renderer
src/blocksToReactComponents.tsx
TypeScript
ArrowFunction
(block: IBlock) => <h2>{blockToText(block)}</h2>, [BLOCKS.HEADING3]
piotrzaborow/notion-blocks-react-renderer
src/blocksToReactComponents.tsx
TypeScript
ArrowFunction
(block: IBlock) => <h3>{blockToText(block)}</h3>, [BLOCKS.BULLETEDLISTITEM]
piotrzaborow/notion-blocks-react-renderer
src/blocksToReactComponents.tsx
TypeScript
ArrowFunction
(block: IBlock) => <li>{blockToText(block)}</li>, [BLOCKS.NUMBEREDLISTITEM]
piotrzaborow/notion-blocks-react-renderer
src/blocksToReactComponents.tsx
TypeScript
ArrowFunction
(block: IBlock) => <li>{blockToText(block)}</li>, [BLOCKS.BULLETEDLIST]
piotrzaborow/notion-blocks-react-renderer
src/blocksToReactComponents.tsx
TypeScript
ArrowFunction
(block: IBlock) => ( <ul> {block.list.map((listItem) => blockRenderer(listItem, defaultRenderers))} </ul> )
piotrzaborow/notion-blocks-react-renderer
src/blocksToReactComponents.tsx
TypeScript
ArrowFunction
(listItem) => blockRenderer(listItem, defaultRenderers)
piotrzaborow/notion-blocks-react-renderer
src/blocksToReactComponents.tsx
TypeScript
ArrowFunction
(block: IBlock) => ( <ol> {block.list.map((listItem) => blockRenderer(listItem, defaultRenderers))} </ol> )
piotrzaborow/notion-blocks-react-renderer
src/blocksToReactComponents.tsx
TypeScript
ArrowFunction
(block: IBlock) => ( <blockquote>{blockToText(block)}</blockquote> )
piotrzaborow/notion-blocks-react-renderer
src/blocksToReactComponents.tsx
TypeScript
ArrowFunction
(block: IBlock) => <code>{blockToText(block)}</code>, [BLOCKS.IMAGE]
piotrzaborow/notion-blocks-react-renderer
src/blocksToReactComponents.tsx
TypeScript
ArrowFunction
(block: IBlock) => <img src
piotrzaborow/notion-blocks-react-renderer
src/blocksToReactComponents.tsx
TypeScript
ArrowFunction
(block) => ( <audio controls
piotrzaborow/notion-blocks-react-renderer
src/blocksToReactComponents.tsx
TypeScript
ArrowFunction
(block) => ( <video controls
piotrzaborow/notion-blocks-react-renderer
src/blocksToReactComponents.tsx
TypeScript
ArrowFunction
(block: IBlock) => <div>{blockToText(block)}</div>,
piotrzaborow/notion-blocks-react-renderer
src/blocksToReactComponents.tsx
TypeScript
ArrowFunction
( blockList: Array<IBlock>, renderers: RenderNode ) => { const remappedContent = remapContent(blockList) return React.Children.toArray( remappedContent.map((block: IBlock) => { return blockRenderer(block, renderers) }) ) }
piotrzaborow/notion-blocks-react-renderer
src/blocksToReactComponents.tsx
TypeScript
ArrowFunction
(block: IBlock) => { return blockRenderer(block, renderers) }
piotrzaborow/notion-blocks-react-renderer
src/blocksToReactComponents.tsx
TypeScript
MethodDeclaration
blockToText(block)
piotrzaborow/notion-blocks-react-renderer
src/blocksToReactComponents.tsx
TypeScript
ClassDeclaration
/** * ユーザー情報の編集ページコンポーネントクラス。 */ @Component({ templateUrl: './user-edit.component.html', }) export class UserEditComponent implements OnInit { /** ユーザー */ user: User; /** エラー情報 */ error: string; /** * サービスをDIしてコンポーネントを生成する。 * @param route ルート情報。 * @param router ルートサービス。 * @param userService ユーザー関連サービス。 */ constructor( private route: ActivatedRoute, private router: Router, private userService: UserService) { } /** * コンポーネント起動時の処理。 * @returns 処理状態。 */ async ngOnInit(): Promise<void> { await this.reset(); } /** * 初期表示への状態リセット。 * @returns 処理状態。 */ async reset(): Promise<void> { const userId = this.route.snapshot.params['id']; this.user = await this.userService.findById(userId); } /** * 更新処理。 * @returns 処理状態。 */ async put(): Promise<void> { try { await this.userService.update(this.user); // 管理者は一覧画面へ、それ以外は自分を変更したはずなので自分の情報へ戻る if (this.userService.me.status === 'admin') { this.router.navigate(['/users']); } else { this.router.navigate(['/users/me']); } } catch (e) { if (!(e instanceof HttpErrorResponse) || e.status !== 400) { throw e; } this.error = `ERROR.${e.error}`; } } }
ktanakaj/breakout-mk
breakout-web/src/app/users/user-edit.component.ts
TypeScript
MethodDeclaration
/** * コンポーネント起動時の処理。 * @returns 処理状態。 */ async ngOnInit(): Promise<void> { await this.reset(); }
ktanakaj/breakout-mk
breakout-web/src/app/users/user-edit.component.ts
TypeScript
MethodDeclaration
/** * 初期表示への状態リセット。 * @returns 処理状態。 */ async reset(): Promise<void> { const userId = this.route.snapshot.params['id']; this.user = await this.userService.findById(userId); }
ktanakaj/breakout-mk
breakout-web/src/app/users/user-edit.component.ts
TypeScript
MethodDeclaration
/** * 更新処理。 * @returns 処理状態。 */ async put(): Promise<void> { try { await this.userService.update(this.user); // 管理者は一覧画面へ、それ以外は自分を変更したはずなので自分の情報へ戻る if (this.userService.me.status === 'admin') { this.router.navigate(['/users']); } else { this.router.navigate(['/users/me']); } } catch (e) { if (!(e instanceof HttpErrorResponse) || e.status !== 400) { throw e; } this.error = `ERROR.${e.error}`; } }
ktanakaj/breakout-mk
breakout-web/src/app/users/user-edit.component.ts
TypeScript
InterfaceDeclaration
interface AddressFormCountryResource { uri?: string; country?: CountryResource; attributes?: FormFieldResource[]; emergencyNumber?: string; default?: boolean; }
jsdelivrbot/ringcentral-ts
src/definitions/AddressFormCountryResource.ts
TypeScript
FunctionDeclaration
export function ViewAddressWarning({ children }: ViewAddressStrikeProps) { const connectedWallet = useConnectedWallet(); return connectedWallet?.connectType === ConnectType.READONLY ? ( <Tooltip title="Currently in “View an Address” mode. To make transactions, please disconnect and reconnect using Terra Station (extension or mobile)." placement="bottom" > <Warning>{children}</Warning> </Tooltip> ) : ( <>{children}</> ); }
0xWWW/anchor-web-app
app/src/components/ViewAddressWarning.tsx
TypeScript
InterfaceDeclaration
export interface ViewAddressStrikeProps { children: ReactNode; }
0xWWW/anchor-web-app
app/src/components/ViewAddressWarning.tsx
TypeScript
ArrowFunction
(inițial: setare locală)
OBCdev/OBC
src/qt/locale/bitcoin_ro_RO.ts
TypeScript
ArrowFunction
(implicit: 17755 sau testnet: 27755)
OBCdev/OBC
src/qt/locale/bitcoin_ro_RO.ts
TypeScript
ArrowFunction
(implicit:17756 sau testnet: 27756)
OBCdev/OBC
src/qt/locale/bitcoin_ro_RO.ts
TypeScript
ArrowFunction
(implicit: 127.0.0.1)
OBCdev/OBC
src/qt/locale/bitcoin_ro_RO.ts
TypeScript
ArrowFunction
(implicit: 100)
OBCdev/OBC
src/qt/locale/bitcoin_ro_RO.ts
TypeScript
ArrowFunction
( $stateParams: IFruitDetailRouteParams, fruitService: FruitService, fruitUtils: FruitUtils) => { // Execute the factory method and cast the result of the async operation to the desired container and return it. return fruitService.GetFruitList().then( (data) => { // Pass the returned array into the service.method along with the desired ID to filter out the desired item. // Note that we case the $stateParams dependency to a custom interface to limit the available parameters, // as opposed to $stateParams['paramName'], which works but is not typed. return fruitUtils.ExtractFruitItem(data.data, Number($stateParams.FruitItemID)); } ); }
DOwen55/ng-rosetta-orig
fruit20-15/src/legacy/fruit15/app.ts
TypeScript
ArrowFunction
(data) => { // Pass the returned array into the service.method along with the desired ID to filter out the desired item. // Note that we case the $stateParams dependency to a custom interface to limit the available parameters, // as opposed to $stateParams['paramName'], which works but is not typed. return fruitUtils.ExtractFruitItem(data.data, Number($stateParams.FruitItemID)); }
DOwen55/ng-rosetta-orig
fruit20-15/src/legacy/fruit15/app.ts
TypeScript
ArrowFunction
( $stateProvider: angular.ui.IStateProvider, $urlRouterProvider: angular.ui.IUrlRouterProvider) => { return new AppConfig($stateProvider, $urlRouterProvider); }
DOwen55/ng-rosetta-orig
fruit20-15/src/legacy/fruit15/app.ts
TypeScript
ClassDeclaration
// Define a configuration object, to be passed into angular's module.config method during startup. export class AppConfig { protected static $inject = ['$stateProvider', '$urlRouterProvider']; constructor( private $stateProvider: angular.ui.IStateProvider, private $urlRouterProvider: angular.ui.IUrlRouterProvider) { this.initializeStates(); } private initializeStates(): void { this.$urlRouterProvider.otherwise('/home'); this.$stateProvider // Home State .state('home', { url: '/home', component: 'homecomponent' }) // Fruit List State .state('fruit-list', { url: '/fruit-list', component: 'fruitlistcomponent' // template: '<fruitlistcomponent></fruitlistcomponent>' }) // Fruit Detail State .state('fruit-detail', { url: '/fruit-detail/{FruitItemID}', // When using Components in Angular 1.5 as the recipient of a state with a resolve, we must map the // $resolve.[property name] to a declared input parameter on the component. // Note that the component must then declare this input via the bindings property on the component // (e.g. bindings { currentfruititem: '<'}). The '<' indicates a one-way binding. // Note too that the parameter name used with bindings must be lower case as the bindings matcher is case insensitve. template: '<fruitdetailcomponent currentfruititem="$resolve.fruitParam"></fruitdetailcomponent>', resolve: { fruitParam: [ '$stateParams', 'fruitService', 'fruitUtils', ( $stateParams: IFruitDetailRouteParams, fruitService: FruitService, fruitUtils: FruitUtils) => { // Execute the factory method and cast the result of the async operation to the desired container and return it. return fruitService.GetFruitList().then( (data) => { // Pass the returned array into the service.method along with the desired ID to filter out the desired item. // Note that we case the $stateParams dependency to a custom interface to limit the available parameters, // as opposed to $stateParams['paramName'], which works but is not typed. return fruitUtils.ExtractFruitItem(data.data, Number($stateParams.FruitItemID)); } ); } ] } }); } }
DOwen55/ng-rosetta-orig
fruit20-15/src/legacy/fruit15/app.ts
TypeScript
InterfaceDeclaration
// Custom interface used to provide a typed property to retrieve state parameters. interface IFruitDetailRouteParams extends ng.ui.IStateParamsService { FruitItemID: string; }
DOwen55/ng-rosetta-orig
fruit20-15/src/legacy/fruit15/app.ts
TypeScript
MethodDeclaration
private initializeStates(): void { this.$urlRouterProvider.otherwise('/home'); this.$stateProvider // Home State .state('home', { url: '/home', component: 'homecomponent' }) // Fruit List State .state('fruit-list', { url: '/fruit-list', component: 'fruitlistcomponent' // template: '<fruitlistcomponent></fruitlistcomponent>' }) // Fruit Detail State .state('fruit-detail', { url: '/fruit-detail/{FruitItemID}', // When using Components in Angular 1.5 as the recipient of a state with a resolve, we must map the // $resolve.[property name] to a declared input parameter on the component. // Note that the component must then declare this input via the bindings property on the component // (e.g. bindings { currentfruititem: '<'}). The '<' indicates a one-way binding. // Note too that the parameter name used with bindings must be lower case as the bindings matcher is case insensitve. template: '<fruitdetailcomponent currentfruititem="$resolve.fruitParam"></fruitdetailcomponent>', resolve: { fruitParam: [ '$stateParams', 'fruitService', 'fruitUtils', ( $stateParams: IFruitDetailRouteParams, fruitService: FruitService, fruitUtils: FruitUtils) => { // Execute the factory method and cast the result of the async operation to the desired container and return it. return fruitService.GetFruitList().then( (data) => { // Pass the returned array into the service.method along with the desired ID to filter out the desired item. // Note that we case the $stateParams dependency to a custom interface to limit the available parameters, // as opposed to $stateParams['paramName'], which works but is not typed. return fruitUtils.ExtractFruitItem(data.data, Number($stateParams.FruitItemID)); } ); } ] } }); }
DOwen55/ng-rosetta-orig
fruit20-15/src/legacy/fruit15/app.ts
TypeScript
ArrowFunction
({ article, updateArticle, deleteArticle, }: ArticleOptions) => { // const buttonRef = useRef(null); const [isOpen, setIsOpen] = React.useState(false); const { portal } = usePortal(); return ( <> <Dropdown placement="bottom-start" portal={portal} isOpen={isOpen} onToggle={(nextState): void
gpn-prototypes/vega-fem
src/components/Shared/Article/ArticleOptionsDropdown/ArticleOptionsDropdown.tsx
TypeScript
ArrowFunction
({ props: menuProps }): React.ReactNode => ( <div className={cnArticleOptionsDropdown('menu')}
gpn-prototypes/vega-fem
src/components/Shared/Article/ArticleOptionsDropdown/ArticleOptionsDropdown.tsx
TypeScript
ArrowFunction
() => setIsOpen(false)
gpn-prototypes/vega-fem
src/components/Shared/Article/ArticleOptionsDropdown/ArticleOptionsDropdown.tsx
TypeScript
InterfaceDeclaration
export interface ArticleOptions { article: Article; updateArticle: (article: Article) => void; deleteArticle: (article: Article) => void; }
gpn-prototypes/vega-fem
src/components/Shared/Article/ArticleOptionsDropdown/ArticleOptionsDropdown.tsx
TypeScript
MethodDeclaration
cnArticleOptionsDropdown('menu')
gpn-prototypes/vega-fem
src/components/Shared/Article/ArticleOptionsDropdown/ArticleOptionsDropdown.tsx
TypeScript
ClassDeclaration
@Component({ selector: 'app-home-index', template: ` <ui-page> <ui-page-title title="Dashboard"></ui-page-title> <div class="row row-cards"> <div class="col-6 col-sm-4 col-lg-2"> <ui-dashboard-stats number="43" title="New Tickets" percentage=6></ui-dashboard-stats> </div> <div class="col-6 col-sm-4 col-lg-2"> <ui-dashboard-stats number="17" title="Closed Today" percentage=-3></ui-dashboard-stats> </div> <div class="col-6 col-sm-4 col-lg-2"> <ui-dashboard-stats number="7" title="New Replies" percentage=9></ui-dashboard-stats> </div> <div class="col-6 col-sm-4 col-lg-2"> <ui-dashboard-stats number="27.3K" title="Followers" percentage=3></ui-dashboard-stats> </div> <div class="col-6 col-sm-4 col-lg-2"> <ui-dashboard-stats number="$95" title="Daily Earnings" percentage=-2></ui-dashboard-stats> </div> <div class="col-6 col-sm-4 col-lg-2"> <ui-dashboard-stats number="621" title="Products" percentage=-1></ui-dashboard-stats> </div> <div class="col-lg-6"> <app-development-activity [purchases]="demoService.purchases" [users]="demoService.users"> </app-development-activity> </div> <div class="col-md-6"> <div class="alert alert-primary"> Are you in trouble? <a href="https://tabler.github.io/tabler-angular/" class="alert-link"> Read our documentation</a> with code samples. </div> <div class="alert alert-warning"> Angular-Tabler works great with Firebase! <a href="https://tabler-angular-fire.firebaseapp.com/" class="alert-link"> Check the example </a> and the <a href="https://github.com/tabler/tabler-angular-firebase" class="alert-link"> source code </a> </div> <div class="row"> <div class="col-sm-6"> <ui-dashboard-chart title="Chart title" [data]="demoService.donut" [doughnut]="true"></ui-dashboard-chart> </div> <div class="col-sm-6"> <ui-dashboard-chart title="Chart title" [data]="demoService.pie"></ui-dashboard-chart> </div> <div class="col-sm-4"> <ui-dashboard-digit color="red" title="New fedbacks" digit="62" width="28%"></ui-dashboard-digit> </div> <div class="col-sm-4"> <ui-dashboard-digit color="green" title="Today profit" digit="$652" width="84%"></ui-dashboard-digit> </div> <div class="col-sm-4"> <ui-dashboard-digit color="yellow" title="Users online" digit="76" width="34%"></ui-dashboard-digit> </div> </div> </div> <div class="col-sm-6 col-lg-3"> <ui-dashboard-icon-box color="blue" icon="fe fe-dollar-sign" value="132" description="Sales" subtitle="12 waiting payments"></ui-dashboard-icon-box> </div> <div class="col-sm-6 col-lg-3"> <ui-dashboard-icon-box color="green" icon="fe fe-shopping-cart" value="78" description="Orders" subtitle="32 shipped"></ui-dashboard-icon-box> </div> <div class="col-sm-6 col-lg-3"> <ui-dashboard-icon-box color="red" icon="fe fe-users" value="1,352" description="Members" subtitle="163 registered today"></ui-dashboard-icon-box> </div> <div class="col-sm-6 col-lg-3"> <ui-dashboard-icon-box color="yellow" icon="fe fe-message-square" value="132" description="Comments" subtitle="16 waiting"></ui-dashboard-icon-box> </div> </div> <div class="row row-cards row-deck"> <!--{% for article in site.data.articles limit: 2 %}--> <div class="col-lg-6"> <!--{% include cards/blog-single.html article=article type="aside" %}--> </div> <!--{% endfor %}--> </div> <div class="row row-cards row-deck"> <div class="col-12"> <app-table-users [users]="demoService.users"></app-table-users> </div> <div class="col-sm-6 col-lg-4"> <ui-card-browser-stats></ui-card-browser-stats> </div> <div class="col-sm-6 col-lg-4"> <ui-card-projects></ui-card-projects> </div> <div class="col-md-6 col-lg-4"> <ui-card-members [users]="demoService.users"></ui-card-members> </div> <div class="col-md-6 col-lg-12"> <div class="row"> <div class="col-sm-6 col-lg-3"> <ui-dashboard-chart-bg title="423" description="Users online" color="blue" rate="+5%"></ui-dashboard-chart-bg> </div> <div class="col-sm-6 col-lg-3"> <ui-dashboard-chart-bg title="423" description="Users online" color="red" rate="-3%"></ui-dashboard-chart-bg> </div> <div class="col-sm-6 col-lg-3"> <ui-dashboard-chart-bg title="423" description="Users online" color="green" rate="-3%"></ui-dashboard-chart-bg> </div> <div class="col-sm-6 col-lg-3"> <ui-dashboard-chart-bg title="423" description="Users online" color="yellow" rate="9%"></ui-dashboard-chart-bg> </div> </div> </div> <div class="col-12"> <app-table-invoices [invoices]="demoService.invoices"></app-table-invoices> <!--{% include cards/invoices.html %}--> </div> </div> </ui-page> `, styles: [], }) export class HomeIndexComponent { constructor(public demoService: DemoService) {} }
CerberusSec/tabler-angular
apps/demo/src/app/home/containers/home-index/home-index.component.ts
TypeScript
FunctionDeclaration
function getSelectionContextSyncEventIds(): string[] { return [SyncUiEventId.SelectionSetChanged, SyncUiEventId.ActiveContentChanged, SyncUiEventId.ActiveViewportChanged, SessionStateActionId.SetNumItemsSelected]; }
BeChaRem/imodeljs
test-apps/ui-test-app/src/frontend/appui/frontstages/Frontstage2.tsx
TypeScript
FunctionDeclaration
function isSelectionSetEmpty(): boolean { const activeContentControl = ContentViewManager.getActiveContentControl(); let selectionCount = 0; if (!UiFramework.frameworkStateKey) selectionCount = UiFramework.store.getState()[UiFramework.frameworkStateKey].frameworkState.sessionState.numItemsSelected; if (activeContentControl && activeContentControl.viewport && (activeContentControl.viewport.view.iModel.selectionSet.size > 0 || selectionCount > 0)) return false; return true; }
BeChaRem/imodeljs
test-apps/ui-test-app/src/frontend/appui/frontstages/Frontstage2.tsx
TypeScript
FunctionDeclaration
function selectionContextStateFunc(state: Readonly<BaseItemState>): BaseItemState { const isVisible = !isSelectionSetEmpty(); return { ...state, isVisible }; }
BeChaRem/imodeljs
test-apps/ui-test-app/src/frontend/appui/frontstages/Frontstage2.tsx
TypeScript
FunctionDeclaration
function getIsHiddenIfSelectionNotActive(): ConditionalBooleanValue { return new ConditionalBooleanValue(isSelectionSetEmpty, getSelectionContextSyncEventIds()); }
BeChaRem/imodeljs
test-apps/ui-test-app/src/frontend/appui/frontstages/Frontstage2.tsx
TypeScript
ArrowFunction
() => { const iModelConnection = UiFramework.getIModelConnection(); if (iModelConnection) { iModelConnection.selectionSet.emptyAll(); } const tool = IModelApp.toolAdmin.primitiveTool; if (tool) tool.onRestartTool(); else IModelApp.toolAdmin.startDefaultTool(); }
BeChaRem/imodeljs
test-apps/ui-test-app/src/frontend/appui/frontstages/Frontstage2.tsx
TypeScript
ClassDeclaration
/* eslint-disable react/jsx-key, deprecation/deprecation */ export class Frontstage2 extends FrontstageProvider { public get frontstage(): React.ReactElement<FrontstageProps> { const contentLayoutDef: ContentLayoutDef = new ContentLayoutDef( { // Four Views, two stacked on the left, two stacked on the right. descriptionKey: "SampleApp:ContentLayoutDef.FourQuadrants", verticalSplit: { percentage: 0.50, minSizeLeft: 100, minSizeRight: 100, left: { horizontalSplit: { percentage: 0.50, top: 0, bottom: 1, minSizeTop: 100, minSizeBottom: 100 } }, right: { horizontalSplit: { percentage: 0.50, top: 2, bottom: 3, minSizeTop: 100, minSizeBottom: 100 } }, }, }, ); const myContentGroup: ContentGroup = new ContentGroup( { contents: [ { classId: "UiFramework.IModelViewportControl", applicationData: { label: "Content 1a", bgColor: "black" }, }, { classId: TreeExampleContentControl, applicationData: { label: "Content 2a", bgColor: "black" }, }, { classId: "TestApp.IModelViewport", applicationData: { label: "Content 3a", bgColor: "black" }, }, { classId: HorizontalPropertyGridContentControl, applicationData: { label: "Content 4a", bgColor: "black" }, }, ], }, ); return ( <Frontstage id="Test2" defaultTool={CoreTools.selectElementCommand} defaultLayout={contentLayoutDef} contentGroup={myContentGroup} isInFooterMode={false} applicationData={{ key: "value" }} contentManipulationTools={ <Zone widgets={[ <Widget isFreeform={true} element={<FrontstageToolWidget />} />, ]}
BeChaRem/imodeljs
test-apps/ui-test-app/src/frontend/appui/frontstages/Frontstage2.tsx
TypeScript
ClassDeclaration
/** Define a ToolWidget with Buttons to display in the TopLeft zone. */ class FrontstageToolWidget extends React.Component { // example toolbar item that hides/shows based on selection set public get myClearSelectionItemDef() { return new CommandItemDef({ commandId: "UiFramework.ClearSelection", iconSpec: "icon-selection-clear", labelKey: "UiFramework:buttons.clearSelection", stateSyncIds: getSelectionContextSyncEventIds(), /* only used when in ui 1.0 mode */ stateFunc: selectionContextStateFunc, /* only used when in ui 1.0 mode */ isHidden: getIsHiddenIfSelectionNotActive(), /* only used when in ui 2.0 mode */ execute: () => { const iModelConnection = UiFramework.getIModelConnection(); if (iModelConnection) { iModelConnection.selectionSet.emptyAll(); } const tool = IModelApp.toolAdmin.primitiveTool; if (tool) tool.onRestartTool(); else IModelApp.toolAdmin.startDefaultTool(); }, }); } private get _horizontalToolbarItems(): ItemList { const items = new ItemList([ SelectionContextToolDefinitions.clearHideIsolateEmphasizeElementsItemDef, SelectionContextToolDefinitions.hideSectionToolGroup, SelectionContextToolDefinitions.isolateSelectionToolGroup, SelectionContextToolDefinitions.emphasizeElementsItemDef, AppTools.item1, AppTools.item2, new GroupItemDef({ groupId: "SampleApp:buttons-toolGroup", labelKey: "SampleApp:buttons.toolGroup", iconSpec: "icon-symbol", items: [AppTools.tool1, AppTools.tool2], itemsInColumn: 7, }), ]); return items; } private get _verticalToolbarItems(): ItemList { const items = new ItemList([AppTools.item3, AppTools.item4, AppTools.item5, AppTools.item6, AppTools.item7, AppTools.item8]); return items; } public override render() { return ( <ToolWidget appButton={AppTools.backstageToggleCommand} horizontalItems={this._horizontalToolbarItems} verticalItems={this._verticalToolbarItems} /> ); } }
BeChaRem/imodeljs
test-apps/ui-test-app/src/frontend/appui/frontstages/Frontstage2.tsx
TypeScript
ClassDeclaration
/** Define a NavigationWidget with Buttons to display in the TopRight zone. */ class FrontstageNavigationWidget extends React.Component { public override render() { const horizontalItems = new ItemList([ CoreTools.fitViewCommand, CoreTools.windowAreaCommand, CoreTools.zoomViewCommand, CoreTools.panViewCommand, CoreTools.rotateViewCommand, ]); const verticalItems = new ItemList([ CoreTools.toggleCameraViewCommand, ]); return ( <NavigationWidget horizontalItems={horizontalItems} verticalItems={verticalItems} /> ); } }
BeChaRem/imodeljs
test-apps/ui-test-app/src/frontend/appui/frontstages/Frontstage2.tsx
TypeScript
MethodDeclaration
public override render() { return ( <ToolWidget appButton={AppTools.backstageToggleCommand} horizontalItems={this._horizontalToolbarItems} verticalItems={this._verticalToolbarItems} /> ); }
BeChaRem/imodeljs
test-apps/ui-test-app/src/frontend/appui/frontstages/Frontstage2.tsx
TypeScript