type stringclasses 7
values | content stringlengths 4 9.55k | repo stringlengths 7 96 | path stringlengths 4 178 | language stringclasses 1
value |
|---|---|---|---|---|
ClassDeclaration | // import { formatGitRepoUrl } from '../../lib/git';
export class GitCloneCommand extends Command {
async getMetadata(): Promise<CommandMetadata> {
return {
name: 'clone',
type: 'global',
summary: 'Clones an Ionic app git repository to your computer',
inputs: [
{
name: 'i... | 1alireza32109/ionic-cli | packages/@ionic/cli/src/commands/git/clone.ts | TypeScript |
MethodDeclaration |
async getMetadata(): Promise<CommandMetadata> {
return {
name: 'clone',
type: 'global',
summary: 'Clones an Ionic app git repository to your computer',
inputs: [
{
name: 'id',
summary: 'The ID of the Ionic Appflow app to clone',
validators: [validators.... | 1alireza32109/ionic-cli | packages/@ionic/cli/src/commands/git/clone.ts | TypeScript |
MethodDeclaration |
async run(inputs: CommandLineInputs, options: CommandLineOptions): Promise<void> {
// let [ id, destination ] = inputs;
// const appLoader = new App(this.env.session.getUserToken(), this.env.client);
// const app = await appLoader.load(id);
// const remote = await formatGitRepoUrl(this.env.config, app... | 1alireza32109/ionic-cli | packages/@ionic/cli/src/commands/git/clone.ts | TypeScript |
ArrowFunction |
() => {
const iconSize = 44;
const [currentMessage] = useSelector(selectSnackbarMessages);
const hideSnackbar = useAction(overlayActions.hideSnackbar);
useEffect(() => {
setTimeout(() => {
hideSnackbar(currentMessage.id);
}, snackbarVisibilityTime);
}, [currentMessage])... | cumeadi/passwords-fountain | src/modules/overlay/components/snackbar/snackbar.component.tsx | TypeScript |
ArrowFunction |
() => {
setTimeout(() => {
hideSnackbar(currentMessage.id);
}, snackbarVisibilityTime);
} | cumeadi/passwords-fountain | src/modules/overlay/components/snackbar/snackbar.component.tsx | TypeScript |
ArrowFunction |
() => {
hideSnackbar(currentMessage.id);
} | cumeadi/passwords-fountain | src/modules/overlay/components/snackbar/snackbar.component.tsx | TypeScript |
ArrowFunction |
({isButtonActive, ...rest}) => <Button {...rest}/> | NarrativeCompany/narrative | react-ui/packages/web/src/shared/components/VoteButton.tsx | TypeScript |
ArrowFunction |
props => !props.isButtonActive &&
`border-color: #e2e6ec !important;
background-color: #f9fafb !important;
color: ${props.theme.textColorDark} !important;
transition: all .15s ease-in-out;
.anticon {
color: #e2e6ec !important;
transition: all .15s ease-in-out;
... | NarrativeCompany/narrative | react-ui/packages/web/src/shared/components/VoteButton.tsx | TypeScript |
ArrowFunction |
(props) => {
// jw: passing the rest of the properties through to StyledButton so that things like event listeners and children
// will work as expected. Discovered when I tried to use a Tooltip with this.
const { isButtonActive, buttonType, onClick, isVoting, isDisabled, ...rest } = props;
return (
<... | NarrativeCompany/narrative | react-ui/packages/web/src/shared/components/VoteButton.tsx | TypeScript |
InterfaceDeclaration |
export interface VoteButtonProps {
isButtonActive: boolean;
buttonType: 'primary' | 'danger';
onClick?: () => void;
isVoting?: boolean;
isDisabled?: boolean;
className?: string;
} | NarrativeCompany/narrative | react-ui/packages/web/src/shared/components/VoteButton.tsx | TypeScript |
ArrowFunction |
async (card: Card): Promise<{ id: string }> =>
stripe.createToken({ card }) | Don-Cryptus/MealsToGo | src/services/checkout/checkout.service.ts | TypeScript |
ArrowFunction |
async (
token: string,
amount: number,
name: string
): Promise<any> => {
const res = await fetch(`${host}/pay`, {
body: JSON.stringify({
token,
name,
amount,
}),
method: "POST",
});
if (res.status > 200) {
// return Promise.reject();
throw new Error("'something went wr... | Don-Cryptus/MealsToGo | src/services/checkout/checkout.service.ts | TypeScript |
FunctionDeclaration |
export function Criteria(field: string): any[] {
return [field];
} | BTDevelop/Serenity | Serenity.TypeScript.CoreLib/Services/Criteria.ts | TypeScript |
FunctionDeclaration |
export function isEmpty(c: any[]): boolean {
return c == null ||
c.length === 0 ||
(c.length === 1 &&
typeof c[0] == "string" &&
c[0].length === 0);
} | BTDevelop/Serenity | Serenity.TypeScript.CoreLib/Services/Criteria.ts | TypeScript |
FunctionDeclaration |
export function join(c1: any[], op: string, c2: any[]): any[] {
if (C.isEmpty(c1))
return c2;
if (C.isEmpty(c2))
return c1;
return [c1, op, c2];
} | BTDevelop/Serenity | Serenity.TypeScript.CoreLib/Services/Criteria.ts | TypeScript |
FunctionDeclaration |
export function paren(c: any[]): any[] {
return C.isEmpty(c) ? c : ['()', c];
} | BTDevelop/Serenity | Serenity.TypeScript.CoreLib/Services/Criteria.ts | TypeScript |
FunctionDeclaration |
export function and(c1: any[], c2: any[], ...rest: any[][]): any[] {
var result = join(c1, 'and', c2);
if (rest) {
for (let k of rest)
result = join(result, 'and', k);
}
return result;
} | BTDevelop/Serenity | Serenity.TypeScript.CoreLib/Services/Criteria.ts | TypeScript |
FunctionDeclaration |
export function or(c1: any[], c2: any[], ...rest: any[][]): any[] {
var result = join(c1, 'or', c2);
if (rest) {
for (let k of rest)
result = join(result, 'or', k);
}
return result;
} | BTDevelop/Serenity | Serenity.TypeScript.CoreLib/Services/Criteria.ts | TypeScript |
ClassDeclaration |
@NgModule({
imports: [
FormsModule,
CommonModule,
RouterModule.forChild(preparationRoute),
],
declarations: [PreparationComponent],
providers: []
})
export class PreparationModule {
} | saykat/client-preparations.xyz | src/app/views/preparation/preparation.module.ts | TypeScript |
ArrowFunction |
(chatState: "hidden" | "show") => {
const [hasUnreadMessages, setHasUnreadMessages] = React.useState(false);
const environment = useRelayEnvironment();
const [playDiceRollSound] = useSound(diceRollSound, {
volume: 0.5,
});
const [playNotificationSound] = useSound(notificationSound, {
volume: 0.5,
}... | Jonyango/dungeon-revealer | src/chat/chat.tsx | TypeScript |
ArrowFunction |
() => {
const subscription = requestSubscription<chatMessageSoundSubscription>(
environment,
{
subscription: ChatMessageSoundSubscription,
variables: {},
onNext: (data) => {
if (data) {
let mode: "dice-roll-message" | "text-message" = "text-message";
... | Jonyango/dungeon-revealer | src/chat/chat.tsx | TypeScript |
ArrowFunction |
(data) => {
if (data) {
let mode: "dice-roll-message" | "text-message" = "text-message";
if (
data.chatMessagesAdded.messages.some(
(message) => message.containsDiceRoll === true
)
) {
mode = "dice-roll-message";
... | Jonyango/dungeon-revealer | src/chat/chat.tsx | TypeScript |
ArrowFunction |
(message) => message.containsDiceRoll === true | Jonyango/dungeon-revealer | src/chat/chat.tsx | TypeScript |
ArrowFunction |
() => subscription.dispose() | Jonyango/dungeon-revealer | src/chat/chat.tsx | TypeScript |
ArrowFunction |
() => setHasUnreadMessages(false) | Jonyango/dungeon-revealer | src/chat/chat.tsx | TypeScript |
ArrowFunction |
({ toggleShowDiceRollNotes }) => {
const [mode, setMode] = React.useState<"chat" | "user" | "settings">("chat");
const environment = useRelayEnvironment();
React.useEffect(() => {
const subscription = requestSubscription<chatSubscription>(environment, {
subscription: AppSubscription,
variables: ... | Jonyango/dungeon-revealer | src/chat/chat.tsx | TypeScript |
ArrowFunction |
() => {
const subscription = requestSubscription<chatSubscription>(environment, {
subscription: AppSubscription,
variables: {},
updater: (store, data) => {
const chat = ConnectionHandler.getConnection(
store.getRoot(),
"chatMessages_chat"
);
const reco... | Jonyango/dungeon-revealer | src/chat/chat.tsx | TypeScript |
ArrowFunction |
(store, data) => {
const chat = ConnectionHandler.getConnection(
store.getRoot(),
"chatMessages_chat"
);
const records = store
.getRootField("chatMessagesAdded")
?.getLinkedRecords("messages");
if (!chat || !records) return;
for (const c... | Jonyango/dungeon-revealer | src/chat/chat.tsx | TypeScript |
ArrowFunction |
() => {
const subscription = requestSubscription<chatUserUpdateSubscription>(
environment,
{
subscription: UserUpdateSubscription,
variables: {},
updater: (store) => {
const users = ConnectionHandler.getConnection(
store.getRoot(),
"chatUserList... | Jonyango/dungeon-revealer | src/chat/chat.tsx | TypeScript |
ArrowFunction |
(store) => {
const users = ConnectionHandler.getConnection(
store.getRoot(),
"chatUserList_users"
);
const updateRecord = store.getRootField("userUpdate");
const root = store.getRoot();
if (!users || !updateRecord) return;
// see ht... | Jonyango/dungeon-revealer | src/chat/chat.tsx | TypeScript |
ArrowFunction |
(): string => {
return generatePassword(32);
} | jasonmacgowan/probot-extended-setup | src/security.ts | TypeScript |
ArrowFunction |
(token: string): string => {
fs.writeFileSync(tokenPath, token);
return tokenPath;
} | jasonmacgowan/probot-extended-setup | src/security.ts | TypeScript |
ArrowFunction |
(): string => {
return fs.readFileSync(tokenPath, "utf8");
} | jasonmacgowan/probot-extended-setup | src/security.ts | TypeScript |
ArrowFunction |
(req: Request, res: Response, next: NextFunction) => {
const allowlist = ["127.0.0.1", "::f", "::ffff:127.0.0.1"];
if (allowlist.indexOf(req.connection.remoteAddress || "") >= 0) {
// allow access from localhost
next();
return;
}
const tokenExists = fs.existsSync(tokenPath);
if (tokenExists) {... | jasonmacgowan/probot-extended-setup | src/security.ts | TypeScript |
ClassDeclaration |
export class ERModel extends SGraph {
name: string
notation: string
} | SchmiedHammer/bigER | webview/src/model.ts | TypeScript |
ClassDeclaration |
export class RelationEdge extends SEdge {
routerKind = PolylineEdgeRouter.KIND;
targetAnchorCorrection = Math.sqrt(5);
} | SchmiedHammer/bigER | webview/src/model.ts | TypeScript |
ClassDeclaration |
export class EntityNode extends RectangularNode {
expanded: boolean
canConnect(routable: SRoutableElement, role: string) {
return true;
}
} | SchmiedHammer/bigER | webview/src/model.ts | TypeScript |
ClassDeclaration |
export class NotationEdge extends SEdge {
isSource: boolean
showRelationship: boolean
notation: String
relationshipCardinality: String
} | SchmiedHammer/bigER | webview/src/model.ts | TypeScript |
ClassDeclaration | /*
export class RelationshipNode extends DiamondNode {
canConnect(routable: SRoutableElement, role: string) {
return true;
}
}
*/
export class CreateRelationPort extends RectangularPort implements CreatingOnDrag {
createAction(id: string): Action {
const edge: SEdgeSchema = {
id,... | SchmiedHammer/bigER | webview/src/model.ts | TypeScript |
ClassDeclaration |
@injectable()
export class MultiplicityLabel extends SLabel implements EdgeLayoutable {
edgePlacement = <EdgePlacement> {
position: 0.5,
side: 'top',
rotate: false,
offset: 5
};
} | SchmiedHammer/bigER | webview/src/model.ts | TypeScript |
ClassDeclaration |
@injectable()
export class InheritanceEdge extends SEdge {
public readonly targetAnchorCorrection = Math.sqrt(5);
public readonly routerKind = ManhattanEdgeRouter.KIND;
} | SchmiedHammer/bigER | webview/src/model.ts | TypeScript |
MethodDeclaration |
canConnect(routable: SRoutableElement, role: string) {
return true;
} | SchmiedHammer/bigER | webview/src/model.ts | TypeScript |
MethodDeclaration |
createAction(id: string): Action {
const edge: SEdgeSchema = {
id,
type: 'edge',
sourceId: this.parent.id,
targetId: this.id
};
return CreateElementAction.create(edge, { containerId: this.root.id });
} | SchmiedHammer/bigER | webview/src/model.ts | TypeScript |
ArrowFunction |
({ slug, data }) => {
const { product } = (useAsyncProduct({ slug }) as unknown) as Product
const [sku] = useSku<Item>(product)
const { commercialOffer } = useBestSeller(sku)
if (product === null || sku === null) {
return null
}
console.log(data)
return (
<>
<Box>
<Offer variant=... | ScarlateAlves/GoStore-Vte | src/@vtex/gatsby-theme-store/components/ProductPage/Above/Async/index.tsx | TypeScript |
InterfaceDeclaration |
interface Props {
slug?: string
data: NonNullable<OrderFormContext['value']>['items']
varian: string
} | ScarlateAlves/GoStore-Vte | src/@vtex/gatsby-theme-store/components/ProductPage/Above/Async/index.tsx | TypeScript |
TypeAliasDeclaration |
type Item = {
itemId: string
sellers: Array<{
sellerId: string
commercialOffer: {
availableQuantity: number
price: number
}
}>
} | ScarlateAlves/GoStore-Vte | src/@vtex/gatsby-theme-store/components/ProductPage/Above/Async/index.tsx | TypeScript |
TypeAliasDeclaration |
type Product = {
product: {
productReference: string
items: Item[]
}
} | ScarlateAlves/GoStore-Vte | src/@vtex/gatsby-theme-store/components/ProductPage/Above/Async/index.tsx | TypeScript |
ClassDeclaration |
export class GithubSettings implements OAuth2Settings {
accessTokenMethod: string;
accountLinking: boolean;
authorizeUrl: string;
callbackUrl: string;
clientId: string;
clientSecret: string;
finalRedirect: string;
providerName: string;
tokenUrl: string;
responseType: string;
constructor(grpcSdk:... | charmitro/Conduit | modules/authentication/src/handlers/github/github.settings.ts | TypeScript |
ClassDeclaration |
@Component({
selector: 'app-home',
templateUrl: 'home.page.html',
styleUrls: ['home.page.scss'],
})
export class HomePage {
@ViewChild('predictImg') predictImg: ElementRef;
imgSrc: string;
model: GraphModel;
isReady = false;
breedPrediction: BreedPrediction;
breedlist: string[] = [
... | JohannesBauer97/dog-classification | dog-classification-app/src/app/home/home.page.ts | TypeScript |
MethodDeclaration |
async presentModal() {
const modal = await this.modalController.create({
component: TutorialComponent,
});
return await modal.present();
} | JohannesBauer97/dog-classification | dog-classification-app/src/app/home/home.page.ts | TypeScript |
MethodDeclaration |
async takePhoto(): Promise<void> {
const capturedPhoto = await Plugins.Camera.getPhoto({
resultType: CameraResultType.Base64,
source: CameraSource.Camera,
quality: 100
});
this.imgSrc = 'data:image/png;base64,' + capturedPhoto.base64String;
const tensor... | JohannesBauer97/dog-classification | dog-classification-app/src/app/home/home.page.ts | TypeScript |
MethodDeclaration |
async loadModel() {
this.model = await tf.loadGraphModel('/assets/modeljs/model.json');
this.isReady = true;
} | JohannesBauer97/dog-classification | dog-classification-app/src/app/home/home.page.ts | TypeScript |
ArrowFunction |
(accountsServer: AccountsServer) => async (
_,
args: {},
ctx: IResolverContext
) => {
const { user } = ctx;
// Make sure user is logged in
if (!(user && user.id)) {
throw new Error('Unauthorized');
}
const password: any = accountsServer.getServices().password as AccountsPassword;
if (!(typeof ... | accounts-js/graphql | packages/graphql-api/src/resolvers/two-factor.ts | TypeScript |
ArrowFunction |
async (
_,
args: {},
ctx: IResolverContext
) => {
const { user } = ctx;
// Make sure user is logged in
if (!(user && user.id)) {
throw new Error('Unauthorized');
}
const password: any = accountsServer.getServices().password as AccountsPassword;
if (!(typeof password.resetPassword === 'function... | accounts-js/graphql | packages/graphql-api/src/resolvers/two-factor.ts | TypeScript |
ArrowFunction |
(accountsServer: AccountsServer) => async (
_,
args: GQL.ITwoFactorSetOnMutationArguments,
ctx: IResolverContext
) => {
const { code, secret } = args;
const { user } = ctx;
// Make sure user is logged in
if (!(user && user.id)) {
throw new Error('Unauthorized');
}
const userId = user.id;
cons... | accounts-js/graphql | packages/graphql-api/src/resolvers/two-factor.ts | TypeScript |
ArrowFunction |
async (
_,
args: GQL.ITwoFactorSetOnMutationArguments,
ctx: IResolverContext
) => {
const { code, secret } = args;
const { user } = ctx;
// Make sure user is logged in
if (!(user && user.id)) {
throw new Error('Unauthorized');
}
const userId = user.id;
const password: any = accountsServer.get... | accounts-js/graphql | packages/graphql-api/src/resolvers/two-factor.ts | TypeScript |
ArrowFunction |
(accountsServer: AccountsServer) => async (
_,
args: GQL.ITwoFactorUnsetOnMutationArguments,
ctx: IResolverContext
) => {
const { code } = args;
const { user } = ctx;
// Make sure user is logged in
if (!(user && user.id)) {
throw new Error('Unauthorized');
}
const userId = user.id;
const pass... | accounts-js/graphql | packages/graphql-api/src/resolvers/two-factor.ts | TypeScript |
ArrowFunction |
async (
_,
args: GQL.ITwoFactorUnsetOnMutationArguments,
ctx: IResolverContext
) => {
const { code } = args;
const { user } = ctx;
// Make sure user is logged in
if (!(user && user.id)) {
throw new Error('Unauthorized');
}
const userId = user.id;
const password: any = accountsServer.getServic... | accounts-js/graphql | packages/graphql-api/src/resolvers/two-factor.ts | TypeScript |
ClassDeclaration |
@Component({
selector: 'app-ngxd-benchmark',
templateUrl: '../ngxd.component.html',
changeDetection: ChangeDetectionStrategy.OnPush,
providers: [ ItemsService ]
})
export class Ngxd100BenchmarkComponent extends NgxdBenchmarkComponent {
constructor(resolver: ComponentResolver, items: ItemsService, m... | DmitryPopov/angular-dynamic-components | src/app/containers/benchmark/ngxd/ngxd-100/ngxd-100.component.ts | TypeScript |
FunctionDeclaration | /// <reference types="node" />
export declare function sleep(ms: number): Promise<NodeJS.Timeout>; | Rumbleship/rfi-gql-framework | lib/helpers/sleep.d.ts | TypeScript |
InterfaceDeclaration | /**
* BatchGetTracesOutput shape
*/
export interface BatchGetTracesOutput extends __aws_sdk_types.MetadataBearer {
/**
* <p>Full traces for the specified requests.</p>
*/
Traces?: Array<_UnmarshalledTrace>;
/**
* <p>Trace IDs of requests that haven't been processed.</p>
*/
UnprocessedTraceIds?: A... | Dylan0916/aws-sdk-js-v3 | clients/browser/client-xray-browser/types/BatchGetTracesOutput.ts | TypeScript |
InterfaceDeclaration |
export interface productos{
idArticulo?: number;
nombreArticulo?: string;
descripcion?: string;
precio?: number;
existencias?: string;
imagen?: string;
idCategoria?: number;
} | Klooy/Ing_software | Edson Arley Sanabria Valencia/Gestion de usuarios/HappyShop/src/app/models/productos.ts | TypeScript |
InterfaceDeclaration |
export interface persona{
idPersona?: number;
nombres?: string;
apellidos?: string;
cedula?: number;
direccion?: string;
telefono?: number;
fechaNacimiento?: Date;
email?: string;
contrasena?: string;
genero?: string;
tipoCuenta?: string;
idCiudad?: number;
idPais?: ... | Klooy/Ing_software | Edson Arley Sanabria Valencia/Gestion de usuarios/HappyShop/src/app/models/productos.ts | TypeScript |
InterfaceDeclaration |
export interface cliente {
idCliente?: number;
direccionFacturacion?: string;
idPersona?: number;
} | Klooy/Ing_software | Edson Arley Sanabria Valencia/Gestion de usuarios/HappyShop/src/app/models/productos.ts | TypeScript |
InterfaceDeclaration |
export interface ciudad {
idCiudad?: number;
nombreCiudad?: string;
idPais?: number;
} | Klooy/Ing_software | Edson Arley Sanabria Valencia/Gestion de usuarios/HappyShop/src/app/models/productos.ts | TypeScript |
InterfaceDeclaration |
export interface pais {
idPais?: number;
nombrePais?: string;
} | Klooy/Ing_software | Edson Arley Sanabria Valencia/Gestion de usuarios/HappyShop/src/app/models/productos.ts | TypeScript |
InterfaceDeclaration |
export interface categoria {
idCategoria?: number;
nombre?: string;
descripcion?: string;
} | Klooy/Ing_software | Edson Arley Sanabria Valencia/Gestion de usuarios/HappyShop/src/app/models/productos.ts | TypeScript |
InterfaceDeclaration |
export interface carrito {
id?: number;
cantidad?: number;
idArticulo?: number;
idCliente?: number;
} | Klooy/Ing_software | Edson Arley Sanabria Valencia/Gestion de usuarios/HappyShop/src/app/models/productos.ts | TypeScript |
InterfaceDeclaration |
export interface pedido{
idPedido?: number;
cantidad?: number;
descuento?: number;
fecha?: Date;
total?: number;
idCliente?: number;
} | Klooy/Ing_software | Edson Arley Sanabria Valencia/Gestion de usuarios/HappyShop/src/app/models/productos.ts | TypeScript |
InterfaceDeclaration |
export interface detallePedido {
idDetallePedido?: number;
metodoPago?: string;
metodoEntrega?: string;
idPedido?: number;
idEmpresaTranspor?: number;
idArticulo?: 0,
cantidad?: 0;
} | Klooy/Ing_software | Edson Arley Sanabria Valencia/Gestion de usuarios/HappyShop/src/app/models/productos.ts | TypeScript |
InterfaceDeclaration |
export interface proveedorArticulo {
id?: number;
idProveedor?: number;
idArticulo?: number;
} | Klooy/Ing_software | Edson Arley Sanabria Valencia/Gestion de usuarios/HappyShop/src/app/models/productos.ts | TypeScript |
InterfaceDeclaration |
export interface proveedor {
idProveedor?: number;
nit?: number;
nombreProveedor?: string;
telefono?: number;
email?: string;
} | Klooy/Ing_software | Edson Arley Sanabria Valencia/Gestion de usuarios/HappyShop/src/app/models/productos.ts | TypeScript |
InterfaceDeclaration |
export interface empresaTransporte {
idEmpresaTranspor?: number;
nombre?: string;
nit?: number;
telefono?: number;
email?: string;
} | Klooy/Ing_software | Edson Arley Sanabria Valencia/Gestion de usuarios/HappyShop/src/app/models/productos.ts | TypeScript |
ArrowFunction | // https://docs.synapse.org/rest/org/sagebionetworks/repo/model/FileEntity.html
(data: FileEntity) => {
const fileHandleAssociationList = [
{
associateObjectId: synapseId,
associateObjectType: FileHandleAssociateType.FileEntity,
fileHandleId: data.dataFile... | conundrumgirl/Synapse-React-Client | src/lib/containers/widgets/SynapseImage.tsx | TypeScript |
ArrowFunction |
(data: BatchFileResult) => {
const { preSignedURL } = data.requestedFiles.filter(el => el.fileHandleId === id)[0] // this.matchToHandle(this.compareById(id, 'fileHandleId'), data.requestedFiles)
this.setState({
preSignedURL: preSignedURL
})
} | conundrumgirl/Synapse-React-Client | src/lib/containers/widgets/SynapseImage.tsx | TypeScript |
ArrowFunction |
el => el.fileHandleId === id | conundrumgirl/Synapse-React-Client | src/lib/containers/widgets/SynapseImage.tsx | TypeScript |
ArrowFunction |
err => {
console.error('Error on getting image ', err)
} | conundrumgirl/Synapse-React-Client | src/lib/containers/widgets/SynapseImage.tsx | TypeScript |
ArrowFunction |
el => el.fileName === fileName | conundrumgirl/Synapse-React-Client | src/lib/containers/widgets/SynapseImage.tsx | TypeScript |
ClassDeclaration |
class SynapseImage extends React.Component<SynapseImageProps, SynapseImageState> {
constructor(props: SynapseImageProps) {
super(props)
this.getEntity = this.getEntity.bind(this)
this.getSynapseFiles = this.getSynapseFiles.bind(this)
this.state = {
preSignedURL: ''
}
}
public getEntit... | conundrumgirl/Synapse-React-Client | src/lib/containers/widgets/SynapseImage.tsx | TypeScript |
TypeAliasDeclaration |
type SynapseImageProps = {
wikiId?: string
synapseId?: string
token?: string
fileName?: string
fileResults?: FileHandle []
params: any
} | conundrumgirl/Synapse-React-Client | src/lib/containers/widgets/SynapseImage.tsx | TypeScript |
TypeAliasDeclaration |
type SynapseImageState = {
preSignedURL: string
} | conundrumgirl/Synapse-React-Client | src/lib/containers/widgets/SynapseImage.tsx | TypeScript |
MethodDeclaration |
public getEntity() {
const { token, synapseId } = this.props
if (synapseId) {
getEntity<FileEntity>(token, synapseId).then(
// https://docs.synapse.org/rest/org/sagebionetworks/repo/model/FileEntity.html
(data: FileEntity) => {
const fileHandleAssociationList = [
{
... | conundrumgirl/Synapse-React-Client | src/lib/containers/widgets/SynapseImage.tsx | TypeScript |
MethodDeclaration |
public getSynapseFiles(fileHandleAssociationList: FileHandleAssociation [], id: string) {
// overload the method for two different use cases, one where
// the image is attached to an entity and creates a list on the spot,
// the other where list is passed in from componentDidMount in MarkdownSynapse
co... | conundrumgirl/Synapse-React-Client | src/lib/containers/widgets/SynapseImage.tsx | TypeScript |
MethodDeclaration |
public componentDidMount() {
if (!this.props.wikiId) {
// Get file handle as external attachment
this.getEntity()
} else {
// Can get presigned url right away from wiki association
const { fileName, fileResults = [] } = this.props
const { id } = fileResults.filter(el => el.fileNam... | conundrumgirl/Synapse-React-Client | src/lib/containers/widgets/SynapseImage.tsx | TypeScript |
MethodDeclaration |
public render() {
const imgStyle: React.CSSProperties = {}
const { params = {}} = this.props
const { align = '' } = params
const alignLowerCase = align.toLowerCase()
let className = ''
if (alignLowerCase === 'left') {
className = 'floatLeft'
}
if (alignLowerCase === 'right') {
... | conundrumgirl/Synapse-React-Client | src/lib/containers/widgets/SynapseImage.tsx | TypeScript |
ArrowFunction |
({ router }) => {
if (__VUEPRESS_SSR__) return
useBaiduAnalytics(__BAIDU_ID__)
if (__BAIDU_SPA__) {
router.beforeEach((to) => {
if (typeof _hmt !== 'undefined') {
// eslint-disable-next-line no-undef
_hmt.push(['_trackPageview', to.fullPath])
}
})
}
} | shentuzhigang/vuepress-theme-star | packages/@starzkg/vuepress-plugin-baidu-analytics/src/client/config.ts | TypeScript |
ArrowFunction |
(to) => {
if (typeof _hmt !== 'undefined') {
// eslint-disable-next-line no-undef
_hmt.push(['_trackPageview', to.fullPath])
}
} | shentuzhigang/vuepress-theme-star | packages/@starzkg/vuepress-plugin-baidu-analytics/src/client/config.ts | TypeScript |
FunctionDeclaration |
function noop() { /* noop */ } | AzureMentor/reactxp | src/native-common/Button.tsx | TypeScript |
FunctionDeclaration |
function applyMixin(thisObj: any, mixin: {[propertyName: string]: any}, propertiesToSkip: string[]) {
Object.getOwnPropertyNames(mixin).forEach(name => {
if (name !== 'constructor' && propertiesToSkip.indexOf(name) === -1) {
assert(
!(name in thisObj),
`An object... | AzureMentor/reactxp | src/native-common/Button.tsx | TypeScript |
ArrowFunction |
name => {
if (name !== 'constructor' && propertiesToSkip.indexOf(name) === -1) {
assert(
!(name in thisObj),
`An object cannot have a method with the same name as one of its mixins: "${name}"`
);
thisObj[name] = mixin[name].bind(thisObj);
... | AzureMentor/reactxp | src/native-common/Button.tsx | TypeScript |
ArrowFunction |
(e: Types.SyntheticEvent) => {
if (this._isTouchFeedbackApplicable()) {
if (this.props.underlayColor) {
if (this._hideTimeout) {
clearTimeout(this._hideTimeout);
this._hideTimeout = undefined;
}
this._showUnderl... | AzureMentor/reactxp | src/native-common/Button.tsx | TypeScript |
ArrowFunction |
(e: Types.SyntheticEvent) => {
if (this._isTouchFeedbackApplicable()) {
if (this.props.underlayColor) {
if (this._hideTimeout) {
clearTimeout(this._hideTimeout);
}
this._hideTimeout = Timers.setTimeout(this._hideUnderlay, _hideUnde... | AzureMentor/reactxp | src/native-common/Button.tsx | TypeScript |
ArrowFunction |
(e: Types.SyntheticEvent) => {
UserInterface.evaluateTouchLatency(e);
if (!this.props.disabled) {
if (EventHelpers.isRightMouseButton(e)) {
if (this.props.onContextMenu) {
this.props.onContextMenu(EventHelpers.toMouseEvent(e));
}
... | AzureMentor/reactxp | src/native-common/Button.tsx | TypeScript |
ArrowFunction |
(e: Types.SyntheticEvent) => {
if (!this.props.disabled && !EventHelpers.isRightMouseButton(e) && this.props.onLongPress) {
this.props.onLongPress(EventHelpers.toMouseEvent(e));
}
} | AzureMentor/reactxp | src/native-common/Button.tsx | TypeScript |
ArrowFunction |
() => {
return 20;
} | AzureMentor/reactxp | src/native-common/Button.tsx | TypeScript |
ArrowFunction |
() => {
return {top: 20, left: 20, right: 20, bottom: 100};
} | AzureMentor/reactxp | src/native-common/Button.tsx | TypeScript |
ArrowFunction |
() => this.focus() | AzureMentor/reactxp | src/native-common/Button.tsx | TypeScript |
ArrowFunction |
() => this._isMounted | AzureMentor/reactxp | src/native-common/Button.tsx | TypeScript |
ArrowFunction |
(btn: any): void => {
this._buttonElement = btn;
} | AzureMentor/reactxp | src/native-common/Button.tsx | TypeScript |
ArrowFunction |
(e: Types.SyntheticEvent) => {
this._isMouseOver = true;
this._onHoverStart(e);
} | AzureMentor/reactxp | src/native-common/Button.tsx | TypeScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.