repo_name stringlengths 5 122 | path stringlengths 3 232 | text stringlengths 6 1.05M |
|---|---|---|
dulsi/gamerzilla.net | frontend/src/Page.tsx | import { FC } from 'react';
import { PageTitle } from './PageTitle';
import './Page.css';
interface Props {
title?: string;
}
export const Page: FC<Props> = ({ title, children }) => (
<div className="Page">
{title && <PageTitle>{title}</PageTitle>}
{children}
</div>
);
|
dulsi/gamerzilla.net | frontend/src/AppSettings.ts | <reponame>dulsi/gamerzilla.net
export const server = 'http://' + window.location.hostname + ':5000';
export const webAPIUrl = `${server}/api`;
// For testing it goes directly against the backend.
// For production it should just be /api.
export const relativeAPIUrl = `${server}/api`; |
dulsi/gamerzilla.net | frontend/src/PageTitle.tsx | <filename>frontend/src/PageTitle.tsx<gh_stars>1-10
import { ReactChild, ReactChildren } from 'react';
import './PageTitle.css';
interface Props {
children?: ReactChild | ReactChildren;
}
export const PageTitle = ( {children}: Props ) => (
<h2 className="PageTitle">{children}</h2>
)
|
dulsi/gamerzilla.net | frontend/src/Header.tsx | import React from 'react';
import { useEffect, useState } from 'react';
import { Link } from 'react-router-dom';
import { UserIcon } from './Icons';
import './Header.css';
import { getWhoami, UserData } from './User';
export const Header = () => {
const [whoami, setWhoami]
= useState<UserData | null>(null);
co... |
dulsi/gamerzilla.net | frontend/src/GameList.tsx | <reponame>dulsi/gamerzilla.net<gh_stars>1-10
import { FC } from 'react';
import { Link } from 'react-router-dom';
import { GameListData } from './GameListData';
import { relativeAPIUrl } from './AppSettings';
import './GameList.css';
interface Props {
userName: string
data: GameListData[];
}
export const GameList:... |
dulsi/gamerzilla.net | frontend/src/HomePage.tsx | <gh_stars>1-10
import { useEffect, useState } from 'react';
import { Link } from 'react-router-dom';
import { Page } from './Page';
import { getUserList, UserData } from './User';
export const HomePage = () => {
const [userlist, setUserList]
= useState<UserData[] | null>(null);
const [userListLoading, setUserL... |
anirudhabhurke/rn-range-slider | index.d.ts | <filename>index.d.ts<gh_stars>0
import React from "react";
declare module "rn-range-slider" {
export interface RangeSliderProps {
rangeEnabled?: boolean;
disabled?: boolean;
valueType?: "number" | "time";
gravity?: "top" | "bottom" | "center";
min?: number | Date;
max?: number | Date;
ste... |
eibens/soundfont | load.ts | /// <reference lib="dom"/>
import loadAudio from "https://cdn.skypack.dev/pin/audio-loader@v1.0.3-CokSVbmyLFozucSZSxQG/mode=imports/optimized/audio-loader.js";
/**
* Defines a sound font as a record of AudioBuffers.
*/
export type SoundFont = Record<PropertyKey, AudioBuffer>;
/**
* Loads a MIDI.js soundfont.
*
... |
eibens/soundfont | gleitz_types.ts | export default {
percussion: null,
acoustic_grand_piano: null,
bright_acoustic_piano: null,
electric_grand_piano: null,
honkytonk_piano: null,
electric_piano_1: null,
electric_piano_2: null,
harpsichord: null,
clavinet: null,
celesta: null,
glockenspiel: null,
music_box: null,
vibraphone: null... |
eibens/soundfont | gleitz.ts | <gh_stars>1-10
import typeMap from "./gleitz_types.ts";
const formatMap = {
ogg: null,
mp3: null,
};
const packMap = {
"FluidR3_GM": null,
"FatBoy": null,
"MusyngKite": null,
};
export type Pack = keyof (typeof packMap);
export type Type = keyof (typeof typeMap);
export type Format = keyof (typeof format... |
eibens/soundfont | cli.ts | import { createLogger, html } from "https://deno.land/x/surv@v0.2.3/mod.ts";
import { cli } from "https://deno.land/x/surv@v0.2.3/cli.ts";
if (import.meta.main) {
await cli({
server: "https://deno.land/x/surv@v0.2.3/serve.ts",
build: [{
cmd: ["deno", "run", "-A", "https://deno.land/x/edcb@v0.5.1/cli.ts... |
eibens/soundfont | index.ts | <gh_stars>1-10
// This triple-slash directive is needed to use the DOM.
/// <reference lib="dom"/>
import * as Gleitz from "./gleitz.ts";
import { load } from "./load.ts";
// Reload the page whenever a WebSocket message is received.
new WebSocket("ws://localhost:1234")
.addEventListener("message", () => window.loca... |
eibens/soundfont | gleitz_test.ts | import {
assert,
assertEquals,
} from "https://deno.land/std@0.101.0/testing/asserts.ts";
import { formats, getUrl, packs, types } from "./gleitz.ts";
Deno.test("types contain common instruments types", () => {
assert(types.includes("acoustic_grand_piano"));
assert(types.includes("flute"));
assert(types.incl... |
sandrolain/simple-lit-element | src/index.ts | import { CSSResultGroup, html, LitElement, TemplateResult, unsafeCSS, css } from "lit";
class SimpleLitElement extends LitElement {
protected state: Map<string, any> = new Map();
setState (key: string | Record<string, any>, value?: any): void {
if(typeof key === "string") {
this.state.set(key, value);
... |
sandrolain/simple-lit-element | demo/main.ts | <filename>demo/main.ts
import element from "./sle/index.js";
element("el-one", /*css*/`
:host {
display: block;
padding: 3em 0;
text-align: center;
background: #FF0000;
color: #FFF;
}
`);
element("el-two", /*css*/`
:host {
display: inline-block;
padding: 3em;
text-align: center;... |
brainhubeu/hadron | packages/hadron-express/src/hadronToExpress.ts | import * as express from 'express';
import * as nodePath from 'path';
import {
IContainer,
IRoute,
Middleware,
IHadronExpressConfig,
IRoutesConfig,
} from './types';
import { Event } from './constants/eventNames';
import CreateRouteError from './errors/CreateRouteError';
import createContainerProxy from './cr... |
brainhubeu/hadron | packages/hadron-express/src/generateMiddlewares.ts | import * as express from 'express';
import { Container } from '@brainhubeu/hadron-core';
import { IRoute, Middleware, HadronMiddleware } from './types';
import GenerateMiddlewareError from './errors/GenerateMiddlewareError';
import prepareRequest from './prepareRequest';
import handleResponseSpec from './handleResponse... |
tqhuy-dev/IGO-BE | src/share/services/account.services.ts | <reponame>tqhuy-dev/IGO-BE
import { Injectable } from '@nestjs/common';
import { Model } from 'mongoose';
import { InjectModel } from '@nestjs/mongoose';
import { Account } from '../../controller/user/interface/account.interface';
@Injectable()
export class AccountService {
constructor(
@InjectModel('Accoun... |
tqhuy-dev/IGO-BE | src/controller/content/interface/content.interface.ts | export interface Content {
user_data: {
username: string,
name: string,
avatar: string
};
username: string;
content: string;
location: {
name: string,
country: string,
checkin: []
},
tag:[],
reaction:{
like: [],
love: [],
... |
tqhuy-dev/IGO-BE | src/controller/travel-places/dto/retrieve-city.dto.ts | import { IsString, IsNotEmpty } from "class-validator";
export class RetrieveCityDto {
@IsString()
@IsNotEmpty()
cityID: string;
} |
tqhuy-dev/IGO-BE | src/controller/travel-places/interface/travel-places.interface.ts | <filename>src/controller/travel-places/interface/travel-places.interface.ts
export class TravelPlaces {
country: string;
name: string;
rate: number;
checkin: number;
weather: any;
trend: string;
description: string;
} |
tqhuy-dev/IGO-BE | src/controller/travel-places/travel-places.controller.ts | <reponame>tqhuy-dev/IGO-BE
import { Controller, Get, Post, HttpStatus, Body, UseGuards, UsePipes, Param } from '@nestjs/common';
import { async } from 'rxjs/internal/scheduler/async';
import { CityService } from 'src/share/services/city.services';
import { CreateTravelPlaceDto } from './dto/create-travel-places.dto';
i... |
tqhuy-dev/IGO-BE | src/controller/travel-places/dto/retrieve-country.dto.ts | import { IsString, IsNotEmpty } from "class-validator";
export class RetrieveCountryDto {
@IsString()
@IsNotEmpty()
countryID: string;
} |
tqhuy-dev/IGO-BE | src/controller/travel-places/interface/location.interface.ts | <reponame>tqhuy-dev/IGO-BE
export class Location {
city: string;
name: string;
rate: number;
checkin: number;
reviews: [];
trend: string;
price: number;
description: string;
address: string;
} |
tqhuy-dev/IGO-BE | src/controller/content/content.controller.ts | import { Controller, Get, Post, Body, HttpStatus, UseGuards, Param, UsePipes, Delete, Req, Put } from '@nestjs/common';
import { ContentService } from 'src/share/services/content.services';
import { async } from 'rxjs/internal/scheduler/async';
import { CreateContentDto } from './dto/create-content.dto';
import { AuthG... |
tqhuy-dev/IGO-BE | src/controller/data-type/data-type.controller.ts | import { Controller, Get, UseGuards, HttpStatus } from '@nestjs/common';
import { AuthGuard } from '@nestjs/passport';
import { async } from 'rxjs/internal/scheduler/async';
import { TYPE_VACATION, TRAVEL_MOVEMENT } from 'src/share/constant/value';
@Controller('data-types')
export class DataTypesController {
const... |
tqhuy-dev/IGO-BE | src/controller/user/dto/edit-user.dto.ts | import { IsString } from "class-validator";
export class EditUserDto {
@IsString()
first_name: string;
@IsString()
last_name: string;
@IsString()
phone: string;
@IsString()
birthday: string;
@IsString()
avatar: string;
@IsString()
password: string;
} |
tqhuy-dev/IGO-BE | src/controller/user/schema/account.schema.ts | <reponame>tqhuy-dev/IGO-BE
import * as mongoose from 'mongoose';
export const AccountSchema = mongoose.Schema({
token: String,
username: String
}); |
tqhuy-dev/IGO-BE | src/controller/user/schema/user.schema.ts | import * as mongoose from 'mongoose';
export const UserSchema = mongoose.Schema({
username: String,
password: <PASSWORD>,
active: Boolean,
first_name: String,
last_name: String,
phone: String,
birthday: String,
follow: Number,
metadata: mongoose.Schema.Types.Mixed,
avatar: String... |
tqhuy-dev/IGO-BE | src/controller/content/dto/create-content.dto.ts | import { IsString, IsNotEmpty, IsNumber } from "class-validator";
export class CreateContentDto {
@IsString()
@IsNotEmpty()
username: string;
@IsString()
@IsNotEmpty()
content: string;
@IsNotEmpty()
location: {
name: string
country: string,
checkin: []
};
... |
tqhuy-dev/IGO-BE | src/share/constant/value.ts | export const SECRET_KEY = 'IGO';
export const TYPE_VACATION = [
{ name: 'Short-term vacation'},
{ name: 'Long-term vacation'},
];
export const TREND_VALUES = [
{ name: 'Normal'},
{ name: 'Hot'},
{ name: 'Best'}
];
export const TRAVEL_MOVEMENT = [
{ name: 'Car'},
{ name: 'Motorbike'},
{... |
tqhuy-dev/IGO-BE | src/controller/travel-places/business/travel-business.ts | import { Injectable } from '@nestjs/common';
@Injectable()
export class TravelBusiness{
constructor() {}
checkValidTrend() {
}
} |
tqhuy-dev/IGO-BE | src/share/services/user.services.ts | <gh_stars>0
import { Injectable } from '@nestjs/common';
import { InjectModel } from '@nestjs/mongoose';
import { Model } from 'mongoose';
import { LoginDto } from 'src/controller/user/dto/login.dto';
import { User } from '../../controller/user/interface/user.interface';
import { UserCreateDto } from 'src/controller/us... |
tqhuy-dev/IGO-BE | src/core/enviroment.ts | <gh_stars>0
export const MONGO_SOURCE = 'mongodb://localhost:27017/IGo'; |
tqhuy-dev/IGO-BE | src/controller/travel-places/travel-places.module.ts | import { Module } from '@nestjs/common';
import { TravelPlacesController } from './travel-places.controller';
import { MongooseModule } from '@nestjs/mongoose';
import { TravelPlacesSchema } from './schema/travel-places.schema';
import { CityService } from 'src/share/services/city.services';
import { LocationSchema } f... |
tqhuy-dev/IGO-BE | src/controller/travel-places/schema/travel-places.schema.ts | <filename>src/controller/travel-places/schema/travel-places.schema.ts
import * as mongoose from 'mongoose';
export const TravelPlacesSchema = mongoose.Schema({
country: String,
name: String,
rate: Number,
checkin: Number,
weather: mongoose.Schema.Types.Mixed,
trend: String,
description: Stri... |
tqhuy-dev/IGO-BE | src/controller/user/user.module.ts | import { Module } from '@nestjs/common';
import { UserController } from './user.controller';
import { UserService } from 'src/share/services/user.services';
import { MongooseModule } from '@nestjs/mongoose';
import { UserSchema } from './schema/user.schema';
import { HttpStrategy } from 'src/share/guard/auth-guard';
im... |
tqhuy-dev/IGO-BE | src/controller/content/dto/reaction-content.dto.ts | <gh_stars>0
import { IsString } from "class-validator";
export class ReactionContentDto {
@IsString()
type: string;
@IsString()
username: string;
@IsString()
id_content: string;
} |
tqhuy-dev/IGO-BE | src/share/services/city.services.ts | import { Injectable } from '@nestjs/common';
import { Model } from 'mongoose';
import { InjectModel } from '@nestjs/mongoose';
import { TravelPlaces } from './../../controller/travel-places/interface/travel-places.interface';
import { CreateTravelPlaceDto } from 'src/controller/travel-places/dto/create-travel-places.dt... |
tqhuy-dev/IGO-BE | src/share/services/content.services.ts | <gh_stars>0
import { Injectable } from '@nestjs/common';
import { InjectModel } from '@nestjs/mongoose';
import { Model } from 'mongoose';
import { Content } from './../../controller/content/interface/content.interface';
import { CreateContentDto } from 'src/controller/content/dto/create-content.dto';
import { User } f... |
tqhuy-dev/IGO-BE | src/controller/content/content.module.ts | <gh_stars>0
import { Module } from '@nestjs/common';
import { ContentsController } from './content.controller';
import { MongooseModule } from '@nestjs/mongoose';
import { ContentSchema } from './schema/content.schema';
import { ContentService } from 'src/share/services/content.services';
import { ContentBusiness } fro... |
tqhuy-dev/IGO-BE | src/controller/travel-places/dto/create-location.dto.ts | import { IsString, IsNotEmpty, IsNumber } from "class-validator";
export class CreateLocationDTO {
@IsString()
@IsNotEmpty()
city: string;
@IsString()
@IsNotEmpty()
name: string;
@IsString()
@IsNotEmpty()
description: string;
@IsString()
@IsNotEmpty()
address: string;... |
tqhuy-dev/IGO-BE | src/app.module.ts | <reponame>tqhuy-dev/IGO-BE<gh_stars>0
import { Module, MiddlewareConsumer } from '@nestjs/common';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { MongooseModule } from '@nestjs/mongoose';
import { MONGO_SOURCE } from './core/enviroment';
import { UserModule } from... |
tqhuy-dev/IGO-BE | src/share/services/country.services.ts | import { Injectable } from '@nestjs/common';
import { InjectModel } from '@nestjs/mongoose';
import { Model } from 'mongoose';
import { Country } from './../../controller/travel-places/interface/country.interface';
import { CreateCountryDto } from './../../controller/travel-places/dto/create-country.dto';
import { WRON... |
tqhuy-dev/IGO-BE | src/controller/user/user.controller.ts | <filename>src/controller/user/user.controller.ts
import { Controller, Get, Post, HttpStatus, UsePipes, Body, UseGuards, Param, Req, Put } from '@nestjs/common';
import { UserService } from 'src/share/services/user.services';
import { ValidationPipe } from '../../share/pipe/validation.pipe';
import { UserCreateDto } fro... |
tqhuy-dev/IGO-BE | src/share/pipe/validation.pipe.ts | import { PipeTransform, Injectable, ArgumentMetadata, BadRequestException } from '@nestjs/common';
import { validate } from 'class-validator';
import { plainToClass } from 'class-transformer';
@Injectable()
export class ValidationPipe implements PipeTransform<any> {
async transform(value: any, { metatype }: Argument... |
tqhuy-dev/IGO-BE | src/controller/user/interface/user.interface.ts | import * as mongoose from 'mongoose';
export interface User {
username: string;
password: string;
active: boolean;
first_name: string;
last_name: string;
phone: string;
birthday: string;
follow: number;
metadata: any;
avatar: string;
friends:[];
} |
tqhuy-dev/IGO-BE | src/controller/data-type/data-types.module.ts | <filename>src/controller/data-type/data-types.module.ts
import { Module } from '@nestjs/common';
import { DataTypesController } from './data-type.controller';
@Module({
controllers: [DataTypesController],
providers: [],
})
export class DataTypesModule {}; |
tqhuy-dev/IGO-BE | src/controller/travel-places/schema/location.schema.ts | <reponame>tqhuy-dev/IGO-BE<filename>src/controller/travel-places/schema/location.schema.ts
import * as mongosee from 'mongoose';
export const LocationSchema = mongosee.Schema({
city: String,
name: String,
rate: Number,
checkin: Number,
reviews:[],
trend: String,
price: Number,
descriptio... |
tqhuy-dev/IGO-BE | src/share/guard/auth-guard.ts | import { Strategy } from 'passport-http-bearer';
import { PassportStrategy } from '@nestjs/passport';
import { Injectable } from '@nestjs/common';
import { AccountService } from '../services/account.services';
@Injectable()
export class HttpStrategy extends PassportStrategy(Strategy) {
constructor(
private reado... |
tqhuy-dev/IGO-BE | src/controller/content/business/content-business.ts | import { Injectable } from '@nestjs/common';
import { TYPE_VACATION } from 'src/share/constant/value';
@Injectable()
export class ContentBusiness {
constructor() {}
checkTypeVacation(type: string) {
let index = TYPE_VACATION.findIndex(o => o.name === type);
if(index === -1) {
r... |
tqhuy-dev/IGO-BE | src/controller/content/schema/content.schema.ts | import * as mongoose from 'mongoose';
export const ContentSchema = mongoose.Schema({
username: String,
content: String,
location: {
name: String,
country: String,
checkin: []
},
tag:[],
reaction:{
like: [],
love: [],
comments:[],
share:[]
... |
tqhuy-dev/IGO-BE | src/share/constant/message.ts | <reponame>tqhuy-dev/IGO-BE<gh_stars>0
export const NOT_FOUND_ACCOUNT = 'Account is not exist';
export const ACCOUNT_EXIST = 'Account is exist';
export const WRONG_TYPE_VACATION = 'Wrong type vacation';
export const WRONG_CITY = 'Not found city';
export const WRONG_COUNTRY = 'Not found country';
export const CREATE_CONT... |
dongmingchao/daedalOS | components/system/Files/FileManager/useFolder.ts | <reponame>dongmingchao/daedalOS
import type { ApiError } from "browserfs/dist/node/core/api_error";
import type Stats from "browserfs/dist/node/core/node_fs_stats";
import {
filterSystemFiles,
getIconByFileExtension,
getShortcutInfo,
} from "components/system/Files/FileEntry/functions";
import type { FileS... |
dongmingchao/daedalOS | components/system/Desktop/Wallpapers/vantaWaves/types.ts | export type VantaWavesConfig = {
color: number;
shininess: number;
mouseControls?: boolean;
touchControls?: boolean;
waveHeight: number;
waveSpeed: number;
zoom?: number;
};
type VantaWavesSettings = VantaWavesConfig & {
el: HTMLElement;
THREE?: unknown;
};
type VantaWaves = {
dest... |
dongmingchao/daedalOS | components/apps/Ruffle/StyledRuffle.ts | import styled from "styled-components";
const StyledRuffle = styled.div`
height: 100%;
width: 100%;
&.drop {
&:before {
color: #ffad33;
content: "Drop an SWF/SPL file";
position: absolute;
font-size: 16px;
font-weight: 600;
width: 100%;
height: 100%;
... |
dongmingchao/daedalOS | components/apps/FileExplorer/Navigation.tsx | import { ROOT_NAME } from "components/apps/FileExplorer/config";
import {
Back,
Down,
Forward,
Refresh,
Up,
} from "components/apps/FileExplorer/NavigationIcons";
import StyledAddressBar from "components/apps/FileExplorer/StyledAddressBar";
import StyledNavigation from "components/apps/FileExplorer/S... |
dongmingchao/daedalOS | components/apps/PDF/StyledControls.ts | import styled from "styled-components";
const StyledControls = styled.nav`
background-color: rgb(50, 54, 57);
box-shadow: 0 0 5px hsla(0, 0%, 10%, 50%);
height: 40px;
position: absolute;
top: ${({ theme }) => theme.sizes.titleBar.height};
width: 100%;
z-index: 1;
ol {
display: flex;
... |
dongmingchao/daedalOS | components/apps/Browser/StyledBrowser.ts | import styled from "styled-components";
const StyledBrowser = styled.div`
iframe {
border: 0;
height: calc(100% - 36px - 33px);
width: 100%;
}
nav {
background-color: rgb(87, 87, 87);
display: flex;
padding: 4px 0;
place-content: center;
place-items: center;
... |
dongmingchao/daedalOS | components/apps/JSDOS/StyledJSDOS.ts | import styled from "styled-components";
const StyledJSDOS = styled.div`
align-items: center;
background-color: #000;
display: flex;
height: 100%;
width: 100%;
canvas {
position: absolute;
image-rendering: pixelated;
image-rendering: crisp-edges;
top: 0 !important;
width: ... |
dongmingchao/daedalOS | components/system/Menu/StyledMenu.ts | import { motion } from "framer-motion";
import styled from "styled-components";
type StyledMenuProps = {
$isSubMenu: boolean;
$x: number;
$y: number;
};
const StyledMenu = styled(motion.nav)<StyledMenuProps>`
background-color: rgb(43, 43, 43);
border: 1px solid rgb(160, 160, 160);
box-shadow: ... |
rohithkrajan/react-redux-ts | src/components/BidsList.tsx | <filename>src/components/BidsList.tsx<gh_stars>1-10
import * as React from 'react';
import { Bid } from '../common/Merchant';
//import {Table} from 'react-bootstrap';
export interface BidsListProps
{
bids:Bid[];
}
export class BidsList extends React.Component<BidsListProps> {
renderBids(bids:Bi... |
rohithkrajan/react-redux-ts | src/components/MerchantsList.test.tsx | <filename>src/components/MerchantsList.test.tsx<gh_stars>1-10
// import * as React from 'react';
// import * as enzyme from 'enzyme';
// import MerchantsList from './MerchantsList';
// import * as Adapter from 'enzyme-adapter-react-16';
// //import { fetchMerchantsSuccess } from '../actions/merchants';
// enzyme.con... |
rohithkrajan/react-redux-ts | src/components/MerchantsList.tsx | <reponame>rohithkrajan/react-redux-ts<gh_stars>1-10
import * as React from 'react';
import { Link } from 'react-router';
import * as merchantTypes from '../types/index';
import { Merchant } from '../common/Merchant';
import {Table} from 'react-bootstrap';
export interface MerchantsListProps
{
merchantsList:merch... |
rohithkrajan/react-redux-ts | src/components/Jumbotron.tsx | <reponame>rohithkrajan/react-redux-ts
import * as React from "react";
export default class HomePage extends React.Component {
public render() {
return (
<div id="hello" className="jumbotron">
<h1 className="display-3 text-center">{"React app"}</h1>
<p className="lead text-center">
... |
rohithkrajan/react-redux-ts | src/routes.tsx | <gh_stars>1-10
import * as React from 'react';
import { Route,IndexRoute } from 'react-router';
import App from './App';
import MerchantIndex from './components/MerchantsIndex';
import HomePage from './components/Jumbotron';
import MerchantDetailsContainer from './containers/MerchantDetailsContainer'
export default (... |
rohithkrajan/react-redux-ts | src/components/Header.tsx | <reponame>rohithkrajan/react-redux-ts
import * as React from "react";
import { Link } from 'react-router';
export interface HeaderProps
{
type:string,
id?:string
}
export default class Header extends React.Component<HeaderProps,object> {
public renderLinks(): JSX.Element {
const { type } = this.p... |
rohithkrajan/react-redux-ts | src/containers/HeaderContainer.ts | //import * as React from 'react';
import { connect } from 'react-redux';
//import { fetchPosts, resetDeletedPost, deletePost, deletePostSuccess, deletePostFailure } from '../actions/posts';
//import { logoutUser } from '../actions/users';
import HomePage from '../components/Jumbotron';
function mapStateToProps(state... |
rohithkrajan/react-redux-ts | src/actions/merchantdetails.ts | <reponame>rohithkrajan/react-redux-ts
import axios, { AxiosPromise } from 'axios';
import * as constants from '../constants'
import { Merchant } from '../common/Merchant';
import { ROOT_URL } from './index';
//import { RESET_ACTIVE_MERCHANT } from '../constants';
export interface FetchMerchant {
type: constants.FET... |
rohithkrajan/react-redux-ts | src/common/Merchant.ts | <gh_stars>1-10
export interface Merchant
{
id:number;
firstName:string;
lastName:string;
avatarUrl:string;
email:string;
phone:string;
hasPremium:boolean;
bids:Bid[];
}
export interface Bid
{
id:string;
carTitle:string;
amount:number;
created:string;
}
|
rohithkrajan/react-redux-ts | src/containers/MerchantDetailsContainer.ts | <filename>src/containers/MerchantDetailsContainer.ts
import { connect,Dispatch } from 'react-redux';
//import { fetchPosts, resetDeletedPost, deletePost, deletePostSuccess, deletePostFailure } from '../actions/posts';
import {fetchMerchant,fetchMerchantSuccess,fetchMerchantFailure,MerchantDetailAction} from '../action... |
rohithkrajan/react-redux-ts | src/components/MerchantsIndex.tsx | import * as React from 'react';
import MerchantListContainer from '../containers/MerchantContainer';
//import HeaderContainer from '../containers/HeaderContainer'
export default class MerchantIndex extends React.Component{
render(){
return (
<div>
<MerchantListCo... |
rohithkrajan/react-redux-ts | src/store/configureStore.dev.ts | // import { createStore, applyMiddleware, compose } from 'redux';
// import * as promise from 'redux-promise';
// import reducer from '../reducers';
// export default function configureStore(initialState) {
// const finalCreateStore = compose(
// applyMiddleware(promise),
// window.devToolsExtension ? windo... |
rohithkrajan/react-redux-ts | src/components/Header.test.tsx | <filename>src/components/Header.test.tsx
import * as React from 'react';
import * as enzyme from 'enzyme';
import Header from './Header';
import * as Adapter from 'enzyme-adapter-react-16';
enzyme.configure({ adapter: new Adapter() });
it("renders 'new merchant' link in the header when type is merchants_index",()=>{... |
rohithkrajan/react-redux-ts | src/types/index.tsx | import {Merchant} from '../common/Merchant';
export interface MerchantsList
{
merchants:Merchant[];
error:any;
loading:boolean;
}
export interface MerchantData
{
merchant:Merchant|null;
error:any;
loading:boolean;
}
export interface StoreState
{
merchantsList:MerchantsList;
newMerchant:... |
rohithkrajan/react-redux-ts | src/store/configureStore.ts | <filename>src/store/configureStore.ts
// if (process.env.NODE_ENV === 'production' || (location && location.hostname !== 'localhost')) {
// // module.exports = require('./configureStore.prod');
// } else {
// module.exports = require('./configureStore.dev');
// } |
rohithkrajan/react-redux-ts | src/actions/merchants.ts | <filename>src/actions/merchants.ts
import axios, { AxiosPromise } from 'axios';
import * as constants from '../constants'
import { Merchant } from '../common/Merchant';
import { ROOT_URL } from './index';
//merchant list
// export const FETCH_MERCHANTS="FETCH_MERCHANTS";
// export const FETCH_MERCHANTS_SUCCESS="FETCH... |
rohithkrajan/react-redux-ts | src/constants/index.tsx | <reponame>rohithkrajan/react-redux-ts
export const FETCH_MERCHANTS="FETCH_MERCHANTS";
export type FETCH_MERCHANTS =typeof FETCH_MERCHANTS;
export const FETCH_MERCHANTS_SUCCESS="FETCH_MERCHANTS_SUCCESS";
export type FETCH_MERCHANTS_SUCCESS=typeof FETCH_MERCHANTS_SUCCESS;
export const FETCH_MERCHANTS_FAILURE="FETCH_MERCH... |
rohithkrajan/react-redux-ts | src/components/MerchantDetails.tsx | <filename>src/components/MerchantDetails.tsx
import * as React from 'react';
//import { Link } from 'react-router';
import * as merchantTypes from '../types/index';
import { Merchant } from '../common/Merchant';
//import {Table} from 'react-bootstrap';
import { BidsList } from './BidsList';
export interface MerchantDe... |
rohithkrajan/react-redux-ts | src/actions/index.tsx | export const ROOT_URL = location.href.indexOf('localhost') > 0 ? 'http://localhost:3001' : '/api'; |
rohithkrajan/react-redux-ts | src/App.tsx | import * as React from 'react';
//import * as ReactDOM from 'react-dom';
import './App.css';
import Header from './components/Header';
//import HeaderContainer from './containers/HeaderContainer';
//import { Button } from 'react-bootstrap';
//import HomePage from './components/Jumbotron'
//const logo = require('./logo.... |
rohithkrajan/react-redux-ts | src/containers/MerchantContainer.ts |
import { connect,Dispatch } from 'react-redux';
//import { fetchPosts, resetDeletedPost, deletePost, deletePostSuccess, deletePostFailure } from '../actions/posts';
import {fetchMerchants,fetchMerchantsSuccess,fetchMerchantsFailure, FetchMerchants} from '../actions/merchants';
import {MerchantsList} from '../component... |
rohithkrajan/react-redux-ts | src/reducers/merchant.tsx | // import { MerchantsAction } from '../actions/merchants';
// import { StoreState } from '../types/index';
// import {FETCH_MERCHANTS,FETCH_MERCHANTS_FAILURE,FETCH_MERCHANTS_SUCCESS,RESET_MERCHANTS,
// FETCH_MERCHANT,RESET_ACTIVE_MERCHANT,FETCH_MERCHANT_FAILURE,FETCH_MERCHANT_SUCCESS} from '../constants/index';
// con... |
prajwal-shelke/open-event-frontend | app/serializers/video-stream.ts | <reponame>prajwal-shelke/open-event-frontend
import ApplicationSerializer from 'open-event-frontend/serializers/application';
export default class VideoStreamSerializer extends ApplicationSerializer {
attrs = {
rooms: { serialize: true }
}
}
|
prajwal-shelke/open-event-frontend | app/components/widgets/forms/social-link-field.ts | <gh_stars>1-10
import Component from '@glimmer/component';
import { tracked } from '@glimmer/tracking';
import { SocialMedia, socialMediaMap, socialMediaSites } from 'open-event-frontend/utils/dictionary/social-media';
interface Args {
site: string
}
export default class SocialLinkField extends Component<Args> {
... |
lopn/ng-zorro-antd | components/tooltip/base.ts | <filename>components/tooltip/base.ts
/**
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/
import { Direction, Directionality } from '@angular/cdk/bidi';
import { CdkConnectedOverlay, CdkOverlayOr... |
filinico/archive-project-cards | src/githubApi.ts | <reponame>filinico/archive-project-cards<filename>src/githubApi.ts<gh_stars>0
import * as github from '@actions/github'
import {Context} from '@actions/github/lib/context'
import * as OctokitTypes from '@octokit/types'
import * as yaml from 'js-yaml'
import * as core from '@actions/core'
type GitHub = ReturnType<typeo... |
filinico/archive-project-cards | src/main.ts | import * as core from '@actions/core'
import * as github from '@actions/github'
import {archivePRCardsFromProject, GitHubContext} from './githubApi'
async function run(): Promise<void> {
try {
const githubToken = core.getInput('GITHUB_TOKEN', {required: true})
let configPath = core.getInput('CONFIG_PATH', {}... |
01alchemist/Kube-Arc | workspaces/services/client/components/common/utils/index.ts | <reponame>01alchemist/Kube-Arc
export * from "./clamp"
export * from "./random"
|
01alchemist/Kube-Arc | workspaces/services/client/components/connected-graph/events/index.ts | <reponame>01alchemist/Kube-Arc
export enum PortEvent {
MOVE_START = 'moveStart',
MOVE = 'move',
MOVE_END = 'moveEnd'
}
export enum ConnectionEvent {
CONNECT = 'connect',
DISCONNECT = 'disconnect',
DISCONNECTED = 'disconnected',
MULTI_CONNECT = 'multi-connect',
MULTI_DISCONNECT = 'multi-disconnect'
}
e... |
01alchemist/Kube-Arc | workspaces/services/client/components/common/utils/clamp.ts | export function clamp(number: number, min: number, max: number) {
return Math.max(min, Math.min(number, max))
}
|
01alchemist/Kube-Arc | workspaces/services/client/components/common/utils/random.ts | <filename>workspaces/services/client/components/common/utils/random.ts
export const randomId = (): string =>
Math.random()
.toString(36)
.substring(2, 8) +
Math.random()
.toString(36)
.substring(2, 8)
|
01alchemist/Kube-Arc | workspaces/services/client/components/kubernetes/index.ts | <filename>workspaces/services/client/components/kubernetes/index.ts
const path = require('path')
const fs = require('fs')
const k8s = require('./swagger.json')
const definitions = Object.keys(k8s.definitions)
const APIs = [
// 'io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta',
'io.k8s.api.core.v1.Service'
// 'io... |
01alchemist/Kube-Arc | workspaces/services/client/store/i18n.ts | import { ActionContext } from "vuex";
export const SET_LANG: string = "SET_LANG";
type i18nState = {
locales: string[];
locale: string;
};
const state = () => ({
locales: ["en", "de"],
locale: "de"
});
const getters = {
locales: (state: i18nState) => state.locales,
locale: (state: i18nState) => state.lo... |
01alchemist/Kube-Arc | workspaces/services/client/components/connected-graph/node-type.ts | export enum NodeStatusType {
ACTIVE = 'active',
INACTIVE = 'inactive',
CRASHED = 'crashed',
STARTING = 'starting'
}
|
01alchemist/Kube-Arc | workspaces/services/client/store/index.ts | type RootState = {
version: string
timestamp: string
}
export const state = () => ({
version: process.env.APP_VERSION,
timestamp: null
})
export const getters = {
version: (state: RootState) => state.version
}
export const actions = {}
export const mutations = {}
// export {
// state,
// getters,
// ... |
01alchemist/Kube-Arc | workspaces/services/client/components/connected-graph/connection.ts | import { randomId } from '../common/utils'
import NodePort from './port.vue'
import { Point } from '../common/types/point'
export class PortConnection {
/* eslint-disable no-useless-constructor */
constructor(
public id: string = randomId(),
public ports: NodePort[] = [],
public anchor: Point = { x: 0,... |
01alchemist/Kube-Arc | workspaces/services/client/store/graph/index.ts | import { ActionContext } from 'vuex'
import { randomId } from '~/components/common/utils'
type GraphState = {
ports: Map<string, any>
connections: Map<string, any>
// connections: any[]
}
const ADD_PORT: string = 'ADD_PORT'
const ADD_CONNECTION: string = 'ADD_CONNECTION'
const REMOVE_CONNECTION: string = 'REMOV... |
01alchemist/Kube-Arc | workspaces/services/client/components/connected-graph/node-configs/service.ts | <reponame>01alchemist/Kube-Arc<filename>workspaces/services/client/components/connected-graph/node-configs/service.ts
export const ServiceNodeConfig = {
type: 'io.k8s.api.core.v1.Service',
properties: {
name: {
component: 'input',
type: 'string',
default: 'Untitled-Service',
data: 'name'... |
kanigoski/SmartSocket | src/app/table/table.component.ts | import { Component, OnInit } from '@angular/core';
declare interface TableData {
headerRow: string[];
dataRows: string[][];
}
@Component({
selector: 'table-cmp',
moduleId: module.id,
templateUrl: 'table.component.html'
})
export class TableComponent implements OnInit{
public tableData1: Table... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.