repo_name stringlengths 5 122 | path stringlengths 3 232 | text stringlengths 6 1.05M |
|---|---|---|
super-effective/colorutil | src/tests/rgbToCmyk.test.ts | import rgbToCmyk from '../rgbToCmyk';
import {
CMYK_BLACK,
CMYK_BLUE,
CMYK_GREEN,
CMYK_RED,
CMYK_TEAL,
RGB_BLACK,
RGB_BLUE,
RGB_GREEN,
RGB_RED,
RGB_TEAL,
} from './data/colors';
/**
* RGB to CMYK
*/
describe('rgbToCmyk', () => {
test('rgbToCmyk - multi value', () => {
const teal = rgbToCmyk... |
super-effective/colorutil | src/tests/hexToHsv.test.ts | import hexToHsv from '../hexToHsv';
import {
HEX_TEAL,
HSV_TEAL,
HSV_WHITE,
HEX_WHITE,
HSV_BLACK,
HEX_BLACK,
HEX_RED,
HSV_RED,
HEX_YELLOW,
HSV_YELLOW,
HEX_GREEN,
HSV_GREEN,
HEX_CYAN,
HSV_CYAN,
HEX_BLUE,
HSV_BLUE,
HEX_MAGENTA,
HSV_MAGENTA,
} from './data/colors';
/**
* HEX to HSV
*... |
super-effective/colorutil | src/tests/getPerceivedLuminance.test.ts | <reponame>super-effective/colorutil
import getPerceivedLuminance from '../getPerceivedLuminance';
import {
RGB_TEAL,
RGB_WHITE,
RGB_BLACK,
} from './data/colors';
/**
* Get Perceptive Luminesces
*/
describe('getPerceivedLuminance', () => {
test('getPerceivedLuminance - color', () => {
const pl = getPerce... |
super-effective/colorutil | src/tests/cmykToRgb.test.ts | <reponame>super-effective/colorutil
import cmykToRgb from '../cmykToRgb';
import {
CMYK_BLACK,
CMYK_BLUE,
CMYK_GREEN,
CMYK_RED,
CMYK_TEAL,
RGB_BLACK,
RGB_BLUE,
RGB_GREEN,
RGB_RED,
RGB_TEAL,
} from './data/colors';
/**
* CMYK to RGB
*/
describe('cmykToRgb', () => {
test('cmykToRgb - multi value'... |
super-effective/colorutil | src/tests/hslToHex.test.ts | <gh_stars>1-10
import hslToHex from '../hslToHex';
import {
HEX_TEAL,
HEX_WHITE,
HEX_BLACK,
HSL_BLACK,
HSL_RED,
HSL_TEAL,
HSL_WHITE,
} from './data/colors';
/**
* HSL to HEX
*/
describe('hslToHex', () => {
test('hslToHex - color', () => {
const teal = hslToHex(HSL_TEAL.hue, HSL_TEAL.saturation, H... |
super-effective/colorutil | src/tests/sanitizeHex.test.ts | import sanitizeHex from '../sanitizeHex';
import { HEX_BLACK } from './data/colors';
/**
* Sanitize Hex String
*/
describe('sanitizeHex', () => {
test('sanitizeHex - clean input', () => {
const validHex = '#ffffff';
const sanitizedHex = sanitizeHex(validHex);
expect(sanitizedHex).toStrictEqual(validHex... |
super-effective/colorutil | src/colorutils.ts | export {
Rgb,
Hsv,
} from './colorTypes';
export { default as cmykToRgb } from './cmykToRgb';
export { default as cmykToHex } from './cmykToHex';
export { default as getPerceivedLuminance } from './getPerceivedLuminance';
export { default as hexToCmyk } from './hexToCmyk'
export { default as hexToHsl } from './hex... |
zhangtao07/amis | examples/components/theme/crud.tsx | /**
* 给自定义组件预览用的 CRUD
*/
export default {
type: 'crud',
syncLocation: false,
data: {
items: [
{
engine: 'Trident',
browser: 'Internet Explorer 4.0',
platform: 'Win 95+',
version: '4',
id: 1
},
{
engine: 'Trident',
browser: 'Internet ... |
zhangtao07/amis | src/actions/ContinueAction.ts | import { RendererEvent } from '../utils/renderer-event';
import {
RendererAction,
ListenerContext,
LoopStatus,
registerAction,
ILogicAction
} from './Action';
export interface IContinueAction extends ILogicAction {
actionType: 'continue';
}
/**
* continue
*
* @export
* @class ContinueAction
* @implem... |
zhangtao07/amis | src/actions/AjaxAction.ts | <reponame>zhangtao07/amis
import omit from 'lodash/omit';
import {Api} from '../types';
import {normalizeApiResponseData} from '../utils/api';
import {ServerError} from '../utils/errors';
import {createObject, isEmpty} from '../utils/helper';
import {RendererEvent} from '../utils/renderer-event';
import {
RendererAct... |
zhangtao07/amis | examples/components/theme/form.tsx | <reponame>zhangtao07/amis
/**
* @file 用于主题预览的表单样式
*/
export default {
type: 'form',
title: '表单项',
mode: 'horizontal',
wrapWithPanel: false,
autoFocus: true,
body: [
{
type: 'group',
body: [
{
type: 'input-text',
name: 'var1',
label: '输入框'
},
... |
zhangtao07/amis | src/components/Tag.tsx | <reponame>zhangtao07/amis<filename>src/components/Tag.tsx
/**
* @file Tag
*/
import React from 'react';
import {themeable, ThemeProps} from '../theme';
import {Icon, getIcon} from './icons';
import {generateIcon} from '../utils/icon';
import {autobind, noop} from '../utils/helper';
export interface TagProps extends... |
zhangtao07/amis | src/components/schema-editor/index.tsx | <reponame>zhangtao07/amis
/**
* 用来定义数据结构的编辑器
*/
import React from 'react';
import {localeable, LocaleProps} from '../../locale';
import {themeable, ThemeProps} from '../../theme';
import type {JSONSchema} from '../../utils/DataScope';
import {uncontrollable} from 'uncontrollable';
import {SchemaEditorItem} from './I... |
zhangtao07/amis | src/components/schema-editor/Item.tsx | import React from 'react';
import {LocaleProps} from '../../locale';
import {ThemeProps} from '../../theme';
import type {JSONSchema} from '../../utils/DataScope';
import {autobind} from '../../utils/helper';
import Checkbox from '../Checkbox';
import InputBox from '../InputBox';
import Select from '../Select';
import ... |
zhangtao07/amis | __tests__/renderers/Table.test.tsx | import React = require('react');
import {render} from '@testing-library/react';
import '../../src/themes/default';
import {render as amisRender} from '../../src/index';
import {makeEnv} from '../helper';
import rows from '../mockData/rows';
test('Renderer:table', () => {
const {container} = render(
amisRender(
... |
zhangtao07/amis | examples/components/Theme.tsx | import From from './theme/form';
import {
colorControls,
fontControls,
sizeControls,
borderControls,
linkControls
} from './theme/vars';
import CRUD from './theme/crud';
function updateTheme(theme: any) {
let varStyleTag = document.getElementById('customVars');
if (!varStyleTag) {
varStyleTag = docum... |
zhangtao07/amis | src/components/table/HeadCellSelect.tsx | <reponame>zhangtao07/amis
/**
* @file table/HeadCellSelect
* @author fex
*/
import React from 'react';
import {findDOMNode} from 'react-dom';
import {themeable, ThemeProps} from '../../theme';
import {LocaleProps, localeable} from '../../locale';
import HeadCellDropDown, {FilterPayload} from './HeadCellDropDown';
... |
zhangtao07/amis | src/components/NumberInput.tsx | <reponame>zhangtao07/amis<filename>src/components/NumberInput.tsx
import React from 'react';
// @ts-ignore
import InputNumber from 'rc-input-number';
import getMiniDecimal, {
DecimalClass,
toFixed
} from 'rc-input-number/lib/utils/MiniDecimal';
import {getNumberPrecision} from 'rc-input-number/lib/utils/numberUtil'... |
zhangtao07/amis | src/locale.tsx | // 多语言支持
import React from 'react';
import hoistNonReactStatic from 'hoist-non-react-statics';
import {resolveVariable} from './utils/tpl-builtin';
export type TranslateFn<T = any> = (str: T, data?: object) => T;
interface LocaleConfig {
[propsName: string]: string;
}
let defaultLocale: string = 'zh-CN';
const lo... |
zhangtao07/amis | src/actions/BreakAction.ts | import { RendererEvent } from '../utils/renderer-event';
import {
RendererAction,
ListenerContext,
LoopStatus,
registerAction,
ILogicAction
} from './Action';
export interface IBreakAction extends ILogicAction {
actionType: 'break';
}
/**
* breach
*
* @export
* @class BreakAction
* @implements {Actio... |
zhangtao07/amis | src/utils/DataSchema.ts | <filename>src/utils/DataSchema.ts
import {DataScope} from './DataScope';
import type {JSONSchema} from './DataScope';
import {guid} from './helper';
/**
* 用来定义数据本身的数据结构,比如有类型是什么,有哪些属性。
*/
export class DataSchema {
// 指向顶级数据作用域
readonly root: DataScope;
readonly idMap: {
[propName: string]: DataScope;
} ... |
zhangtao07/amis | src/components/formula/VariableList.tsx | <gh_stars>0
import React from 'react';
import {themeable, ThemeProps} from '../../theme';
import GroupedSelection from '../GroupedSelection';
import Tabs, {Tab} from '../Tabs';
import TreeSelection from '../TreeSelection';
import SearchBox from '../SearchBox';
import {filterTree, flattenTree} from '../../utils/helper'... |
zhangtao07/amis | src/renderers/Form/wrapControl.tsx | <reponame>zhangtao07/amis<filename>src/renderers/Form/wrapControl.tsx
import React from 'react';
import {IFormStore, IFormItemStore} from '../../store/form';
import debouce from 'lodash/debounce';
import {RendererProps, Renderer} from '../../factory';
import {ComboStore, IComboStore, IUniqueGroup} from '../../store/co... |
zhangtao07/amis | src/renderers/Form/Checkbox.tsx | <reponame>zhangtao07/amis
import React from 'react';
import {FormItem, FormControlProps, FormBaseControl} from './Item';
import cx from 'classnames';
import Checkbox from '../../components/Checkbox';
import {withBadge, BadgeSchema} from '../../components/Badge';
import {autobind, createObject} from '../../utils/helper'... |
zhangtao07/amis | src/actions/ToastAction.ts | import {RendererEvent} from '../utils/renderer-event';
import {
RendererAction,
ListenerContext,
registerAction,
ListenerAction
} from './Action';
export interface IToastAction extends ListenerAction {
actionType: 'toast';
args: {
msg: string;
msgType?: string;
position?:
| 'top-right'
... |
zhangtao07/amis | src/components/schema-editor/SchemaVariableListPicker.tsx | import React from 'react';
import {localeable} from '../../locale';
import {themeable} from '../../theme';
import PickerContainer from '../PickerContainer';
import SchemaVariableList, {
SchemaVariableListProps
} from './SchemaVariableList';
export interface SchemaVariableListPickerProps extends SchemaVariableListPro... |
zhangtao07/amis | src/components/Rating.tsx | <reponame>zhangtao07/amis<filename>src/components/Rating.tsx
/**
* @file Rating
* @description
* @author fex
*/
import React from 'react';
import cx from 'classnames';
import {ClassNamesFn, themeable} from '../theme';
import {isObject} from '../utils/helper';
import {
validations
} from '../utils/validations';
... |
zhangtao07/amis | src/renderers/Remark.tsx | <reponame>zhangtao07/amis<gh_stars>0
import React from 'react';
import {Renderer, RendererProps} from '../factory';
import {Api, SchemaNode, Schema, Action} from '../types';
import cx from 'classnames';
import TooltipWrapper, {TooltipObject} from '../components/TooltipWrapper';
import {filter} from '../utils/tpl';
impo... |
zhangtao07/amis | __tests__/renderers/Form/chainedSelect.test.tsx | import React = require('react');
import {render, waitForElementToBeRemoved} from '@testing-library/react';
import '../../../src/themes/default';
import {render as amisRender} from '../../../src/index';
import {makeEnv, wait} from '../../helper';
test('Renderer:chained-select', async () => {
const {container, findByT... |
zhangtao07/amis | examples/components/theme/vars.tsx | <gh_stars>0
/**
* 基础变量配置项,生成对应的 combo 配置项
*/
const colors = [
{
label: '文字颜色',
name: '--text-color',
cxdValue: '#666',
antdValue: 'rgba(0, 0, 0, 0.85)'
},
{
label: '文字置灰时的颜色',
name: '--text--muted-color',
cxdValue: '#a6a6a6',
antdValue: 'rgba(64, 64, 64, 0.85)'
},
{
labe... |
zhangtao07/amis | src/renderers/Table-v2/TableCell.tsx | <reponame>zhangtao07/amis<gh_stars>0
import {Renderer} from '../../factory';
import {TableCell} from '../Table';
import QuickEdit from '../QuickEdit';
import Copyable from '../Copyable';
import PopOverable from '../PopOver';
@Renderer({
type: 'cell-field',
name: 'cell-field'
})
@PopOverable()
@Copyable()
@QuickEdi... |
zhangtao07/amis | src/SchemaRenderer.tsx | import difference from 'lodash/difference';
import omit from 'lodash/omit';
import React from 'react';
import LazyComponent from './components/LazyComponent';
import {
filterSchema,
loadRenderer,
RendererComponent,
RendererConfig,
RendererEnv,
RendererProps,
resolveRenderer
} from './factory';
import {asF... |
zhangtao07/amis | src/actions/SwitchAction.ts | import { RendererEvent } from '../utils/renderer-event';
import { evalExpression } from '../utils/tpl';
import {
RendererAction,
ListenerContext,
registerAction,
runActions,
ILogicAction
} from './Action';
export interface ISwitchAction extends ILogicAction {
actionType: 'switch';
}
/**
* 排他动作
*/
export... |
zhangtao07/amis | src/utils/DataScope.ts | <filename>src/utils/DataScope.ts<gh_stars>0
import type {JSONSchema7} from 'json-schema';
import {guid, keyToPath, mapTree} from './helper';
// 先只支持 JSONSchema draft07 好了
// https://json-schema.org/draft-07/json-schema-release-notes.html
export type JSONSchema = JSONSchema7;
export class DataScope {
// 指向父级
paren... |
zhangtao07/amis | __tests__/renderers/Form/select.test.tsx | <gh_stars>0
import React = require('react');
import {render, screen, fireEvent, waitFor} from '@testing-library/react';
import '../../../src/themes/default';
import {render as amisRender} from '../../../src/index';
import {makeEnv, wait} from '../../helper';
test('Renderer:select menutpl', () => {
const {container} ... |
UsmanTariq02/quiz_player | src/modules/quiz/dto/CreateQuiz.dto.ts | <reponame>UsmanTariq02/quiz_player
import { IsNotEmpty, Length } from 'class-validator';
export class CreateQuizDto {
// Validations On Inputs of Data from User side
@IsNotEmpty({
message: "Title Required"
})
@Length(3)
title: string;
@IsNotEmpty({
message: "Description is requ... |
UsmanTariq02/quiz_player | src/modules/quiz/quiz.entity.ts | <gh_stars>0
import { BaseEntity, Column, Entity, PrimaryGeneratedColumn } from "typeorm";
// Here Quizes is Table Name
@Entity('quizes')
export class Quiz extends BaseEntity {
// Primary Generated Column is for Auto Incremented Key ID
@PrimaryGeneratedColumn({
comment: 'The Quiz Unique Identifier',
... |
UsmanTariq02/quiz_player | src/modules/quiz/quiz.service.ts | <reponame>UsmanTariq02/quiz_player
import { Injectable, Get } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
import { CreateQuizDto } from './dto/CreateQuiz.dto';
import { QuizRepository } from './quiz.repository';
export class QuizService {
constructor(
@InjectRepository(QuizRe... |
UsmanTariq02/quiz_player | src/modules/quiz/quiz.repository.ts | import { EntityRepository, Repository } from "typeorm";
import {Quiz} from "./quiz.entity";
//EntityRepository is a Decorator and Quiz here is an Entity which we already crated to create a table in database
@EntityRepository(Quiz)
//Export Class QuizRepository extends with Repository class and inside the signs we are ... |
UsmanTariq02/quiz_player | src/modules/quiz/quiz.controller.ts | import { Controller , Get, Post, Body, HttpCode, UsePipes, ValidationPipe } from '@nestjs/common';
import { CreateQuizDto } from './dto/CreateQuiz.dto';
import { QuizService } from './quiz.service';
@Controller('quiz')
export class QuizController {
constructor(private quizService: QuizService) {}
@Get('/')
... |
clarencetw/cdk-nyancat | test/default.test.ts | import * as ec2 from '@aws-cdk/aws-ec2';
import * as cdk from '@aws-cdk/core';
import { NyanCat } from '../src/index';
let app: cdk.App;
let env: { region: string; account: string };
let stack: cdk.Stack;
beforeEach(() => {
app = new cdk.App();
env = {
region: 'us-east-1',
account: '888888888888',
};
... |
clarencetw/cdk-nyancat | src/integ.default.ts | <reponame>clarencetw/cdk-nyancat
import * as ec2 from '@aws-cdk/aws-ec2';
import * as cdk from '@aws-cdk/core';
import { NyanCat } from './index';
const app = new cdk.App();
const env = {
region: process.env.CDK_DEFAULT_REGION,
account: process.env.CDK_DEFAULT_ACCOUNT,
};
const stack = new cdk.Stack(app, 'stack'... |
clarencetw/cdk-nyancat | src/index.ts | import * as path from 'path';
import * as ec2 from '@aws-cdk/aws-ec2';
import * as assets from '@aws-cdk/aws-s3-assets';
import * as cdk from '@aws-cdk/core';
/**
* The interface for NyanCat
*/
export interface NyanCatProps {
/**
* The VPC
*/
readonly vpc?: ec2.IVpc;
/**
* The Instance Type
*
*... |
AndreLSnyk/snyk-user-sync-tool | test/inputUtils.test.ts | import { validateUserMembership } from '../src/lib/inputUtils'
import { Membership } from '../src/lib/types'
import * as customErrors from '../src/lib/customErrors'
const membershipWithInvalidRole: Membership = {
"userEmail": "<EMAIL>",
"role": "administrator",
"org": "Starfighter Corps Gold Squadron",
... |
AndreLSnyk/snyk-user-sync-tool | src/lib/snykGroupsMetadata.ts | import { requestsManager } from 'snyk-request-manager';
import * as debugLib from 'debug';
import { GroupMetadata, GroupOrg } from './types';
import * as common from './common';
const debug = debugLib('snyk:snykGroupsMetadata');
export class snykGroupsMetadata {
snykKeys: string;
private _groupsMetadata: GroupMet... |
AndreLSnyk/snyk-user-sync-tool | src/lib/common.ts | <gh_stars>1-10
// to catch base directory variations on both windows and *nix
export const BASE_DIR = __dirname.replace(
/(\/|\\)(dist$|dist(\/|\\).*|src\/lib$)/,
'/',
);
//export const DB_DIR = BASE_DIR.concat('db');
export const DB_DIR = 'db';
//export const PREV_DIR = BASE_DIR.concat('prev/');
export const PREV_... |
AndreLSnyk/snyk-user-sync-tool | src/lib/types.ts | export interface PendingInvite {
groupName: string;
groupId: string;
orgName: string;
orgId: string;
userEmail: string;
date: Date;
}
export interface Membership {
userEmail: string;
role: string;
org: string;
group: string;
}
export interface GroupMember {
id: string;
username: string;
name... |
AndreLSnyk/snyk-user-sync-tool | src/lib/index.ts | #!/usr/bin/env node
import * as yargs from 'yargs';
import * as debugLib from 'debug';
import { processMemberships } from './app';
import * as utils from './utils';
import { printKeys, initializeDb, backupUserMemberships } from './inputUtils';
import {
PREV_DIR,
PENDING_INVITES_FILE,
DRY_RUN_FLAG,
INVITE_TO_ALL... |
AndreLSnyk/snyk-user-sync-tool | src/lib/customErrors.ts | export class InvalidRole extends Error {
constructor(message: string) {
super(message);
this.name = 'InvalidRole';
}
}
export class InvalidEmail extends Error {
constructor(message: string) {
super(message);
this.name = 'InvalidEmailAddress';
}
}
export class OrgIdNotFound extends Error {
co... |
AndreLSnyk/snyk-user-sync-tool | src/lib/utils.ts | import { requestsManager } from 'snyk-request-manager';
import * as debugLib from 'debug';
import * as fs from 'fs';
import * as path from 'path';
import { snykGroup } from './snykGroup';
import {
GroupMember,
PendingInvite,
Membership,
PendingMembership,
GroupOrg,
v2Group,
} from './types';
import * as inp... |
AndreLSnyk/snyk-user-sync-tool | src/lib/inputUtils.ts | <reponame>AndreLSnyk/snyk-user-sync-tool
import * as fs from 'fs';
import * as debugLib from 'debug';
import * as path from 'path';
import { snykGroup } from './snykGroup';
import * as common from './common';
import * as utils from './utils';
import { GroupMember, Membership, PendingInvite } from './types';
import * as... |
blu-world/shengji | frontend/src/Confetti.tsx | import * as React from "react";
import Timeout from "./Timeout";
import * as confetti from "canvas-confetti";
interface IProps {
confetti: string;
clearConfetti: () => void;
}
const Confetti = (props: IProps): JSX.Element => {
const duration = 30000;
const canvasRef = React.useCallback((canvas) => {
if (c... |
blu-world/shengji | frontend/src/ReadyCheck.tsx | <gh_stars>10-100
import * as React from "react";
import { WebsocketContext } from "./WebsocketProvider";
const ReadyCheck = (): JSX.Element => {
const { send } = React.useContext(WebsocketContext);
return (
<button
onClick={() =>
confirm("Are you ready to start the game?") && send("ReadyCheck")
... |
blu-world/shengji | frontend/src/Draw.tsx | /* tslint:disable:max-classes-per-file variable-name forin */
import * as React from "react";
import { IDrawPhase, IPlayer } from "./types";
import Header from "./Header";
import Players from "./Players";
import LabeledPlay from "./LabeledPlay";
import BeepButton from "./BeepButton";
import BidArea from "./BidArea";
im... |
blu-world/shengji | frontend/src/WasmContext.tsx | <reponame>blu-world/shengji
import * as React from "react";
import {
ITrump,
ITrickUnit,
IBid,
IHands,
IPlayer,
IUnitLike,
ITrickFormat,
BidPolicy,
BidReinforcementPolicy,
IDeck,
ITrick,
TrickDrawPolicy,
IGameScoringParameters,
JokerBidPolicy,
ITractorRequirements,
} from "./types";
inter... |
blu-world/shengji | frontend/src/DebugInfo.tsx | <filename>frontend/src/DebugInfo.tsx
import * as React from "react";
import { AppStateContext } from "./AppStateProvider";
export const DebugInfo = (_props: {}): JSX.Element => {
const appState = React.useContext(AppStateContext);
return (
<pre>
{JSON.stringify(
{
gameState: appState.s... |
blu-world/shengji | frontend/src/Card.tsx | import * as React from "react";
import classNames from "classnames";
import memoize from "./memoize";
import InlineCard from "./InlineCard";
import { cardLookup } from "./util/cardHelpers";
import { SettingsContext } from "./AppStateProvider";
import { ISuitOverrides } from "./state/Settings";
const SvgCard = React.l... |
blu-world/shengji | frontend/src/WasmProvider.tsx | import * as React from "react";
import * as Shengji from "../shengji-wasm/pkg/shengji-core.js";
import WasmContext from "./WasmContext";
import { ITrump, ITractorRequirements } from "./types";
interface IProps {
children: React.ReactNode;
}
const ShengjiProvider = (props: IProps): JSX.Element => {
(window as any).... |
blu-world/shengji | frontend/src/Exchange.tsx | /* tslint:disable:max-classes-per-file variable-name forin */
import * as React from "react";
import BeepButton from "./BeepButton";
import BidArea from "./BidArea";
import Trump from "./Trump";
import FriendSelect from "./FriendSelect";
import InlineCard from "./InlineCard";
import Card from "./Card";
import Header fr... |
blu-world/shengji | frontend/src/ScoringSettings.tsx | <gh_stars>10-100
import * as React from "react";
import { IGameScoringParameters, IDeck } from "./types";
import { WebsocketContext } from "./WebsocketProvider";
import { WasmContext, IScoreSegment } from "./WasmContext";
interface IProps {
params: IGameScoringParameters;
decks: IDeck[];
}
export const GameScorin... |
blu-world/shengji | frontend/src/state/Settings.ts | <filename>frontend/src/state/Settings.ts
import { State, combineState } from "../State";
import {
booleanLocalStorageState,
JSONLocalStorageState,
} from "../localStorageState";
export interface Settings {
fourColor: boolean;
darkMode: boolean;
showCardLabels: boolean;
showLastTrick: boolean;
beepOnTurn:... |
blu-world/shengji | frontend/src/RandomizePlayersButton.tsx | <reponame>blu-world/shengji<filename>frontend/src/RandomizePlayersButton.tsx
import * as React from "react";
import { IPlayer } from "./types";
import { WebsocketContext } from "./WebsocketProvider";
import ArrayUtils from "./util/array";
interface Props {
players: IPlayer[];
children: string | JSX.Element | JSX.E... |
weikinhuang/nbd.js | Class.d.ts | export interface ClassBuilder<I> {
new(...args: any[]): I;
extend<T extends I, G extends {} = {}>(proto: T, statics?: G): ClassBuilder<T> & G;
mixin<T>(this: T, ...args: any[]): T;
inherits(superclass: any): boolean;
}
declare const _default: ClassBuilder<any>;
export default _default;
|
weikinhuang/nbd.js | View/Entity.d.ts | <reponame>weikinhuang/nbd.js
export * from '../View';
export { default } from '../View';
|
weikinhuang/nbd.js | util/construct.d.ts | export default function construct<T = any>(this: T): T;
|
weikinhuang/nbd.js | View/Element.d.ts | <filename>View/Element.d.ts
import {
ViewConstructorProps,
ViewConstructor as NbdViewConstructor,
ViewInstance as NbdViewInstance,
NbdElement,
} from '../View';
export { ViewConstructorProps } from '../View';
export interface ViewInstance extends NbdViewInstance {
$parent: NbdElement;
}
export interface Vie... |
weikinhuang/nbd.js | trait/responsive.d.ts | <reponame>weikinhuang/nbd.js<filename>trait/responsive.d.ts
import { ViewInstance } from '../View';
export interface ResponsiveTrait {
requestView(ViewClass: ViewInstance): void;
}
declare const _default: ResponsiveTrait;
export default _default;
|
weikinhuang/nbd.js | util/media.d.ts | <filename>util/media.d.ts
export default function media(options: any, query: string): any;
|
weikinhuang/nbd.js | Controller/Entity.d.ts | export * from '../Controller';
export { default } from '../Controller';
|
weikinhuang/nbd.js | Model.d.ts | import { ClassBuilder } from './Class';
import { PubSubTrait } from './trait/pubsub';
export interface ModelInstance extends PubSubTrait {
new(id: string, data: any): this;
// from nbd class
_super(...args: any[]): any;
init(id: string, data: any): void;
_id: string;
_data: any;
_dirty: number;
defa... |
weikinhuang/nbd.js | util/throttle.d.ts | export default function throttle<T>(fn: (...args: any[]) => Promise<T>, ...args: any[]): Promise<T>;
|
weikinhuang/nbd.js | util/diff.d.ts | export default function diff(cur: Object, prev: Object, callback?: (key: string, lhs: any, rhs: any) => void): { [k: string]: any; };
|
weikinhuang/nbd.js | util/extend.d.ts | // copied over from Object.assign
export default function assign<T, U>(target: T, source: U): T & U;
|
weikinhuang/nbd.js | Promise.d.ts | // for now, let's assume nbd/Promise is exactly the same as a native one
export default Promise;
|
weikinhuang/nbd.js | util/pipe.d.ts | export default function pipe<T = any>(...args: Function[]): T;
|
weikinhuang/nbd.js | trait/promise.d.ts | <filename>trait/promise.d.ts
export interface PromiseTrait<T> {
then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): Promise<TResult1 | TResult2>;
catch<TResult = ... |
weikinhuang/nbd.js | Logger.d.ts | import { PubSubTrait } from './trait/pubsub';
export interface Logger extends PubSubTrait {
new(name: any): this;
levels: string[];
name: string;
container: any;
level: string;
destroy(): void;
setLevel(level: string): void;
attach(route: any): void;
remove(route: any): void;
debug(...args: any[... |
weikinhuang/nbd.js | util/mixin.d.ts | <filename>util/mixin.d.ts
export default function mixin(target: any, abstract: any): void;
|
weikinhuang/nbd.js | util/deparam.d.ts | <reponame>weikinhuang/nbd.js<filename>util/deparam.d.ts<gh_stars>0
export default function deparam(params: string, coerce?: boolean): { [k:string]: any; };
|
weikinhuang/nbd.js | View.d.ts | import { ClassBuilder } from './Class';
import { PubSubTrait } from './trait/pubsub';
export type NbdElement = JQuery | HTMLElement;
export interface ViewInstance extends PubSubTrait {
new(model?: any): this;
// from nbd class
_super(...args: any[]): any;
init(config?: any): void;
_model: any;
nests: any... |
weikinhuang/nbd.js | Controller/Responsive.d.ts | import { ResponsiveTrait } from '../trait/responsive';
import {
ControllerConstructorProps,
ControllerConstructor as NbdControllerConstructor,
ControllerInstance as NbdControllerInstance,
} from '../Controller';
export { ControllerConstructorProps } from '../Controller';
export interface ControllerInstance exten... |
weikinhuang/nbd.js | util/async.d.ts | <filename>util/async.d.ts
export default function async(handler: (...args: any[]) => void): void;
|
weikinhuang/nbd.js | trait/log.d.ts | <reponame>weikinhuang/nbd.js
import { Logger } from '../Logger';
export { Logger } from '../Logger';
export interface LogTrait {
log: Logger;
}
declare const _default: LogTrait;
export default _default;
|
weikinhuang/nbd.js | Controller.d.ts | import { ClassBuilder } from './Class';
import { ModelInstance, ModelConstructor } from './Model';
import { ViewInstance, ViewConstructor } from './View';
import { PubSubTrait } from './trait/pubsub';
export interface ControllerInstance extends PubSubTrait {
new(...args: any[]): this;
// from nbd class
_super(.... |
weikinhuang/nbd.js | trait/pubsub.d.ts | export type evtCallback = (...args: any[]) => any;
export interface PubSubTrait {
on(event: string, callback: evtCallback, context?: any): this;
one(event: string, callback: evtCallback, context?: any): this;
off(event: string, callback?: evtCallback, context?: any): this;
trigger(event: string, ...args: any[]... |
maplecloudy/shopizer-admin | src/app/pages/content/content-routing.module.ts | import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { ContentComponent } from './content.component';
import { PageComponent } from './pages/page.component';
import { BoxesComponent } from './boxes/boxes.component';
import { AddPageComponent } from './pages/add-page.... |
maplecloudy/shopizer-admin | src/app/pages/user-management/users-list/button-render-user.component.ts | import { Component, Input } from '@angular/core';
import { TranslateService } from '@ngx-translate/core';
import { ToastrService } from 'ngx-toastr';
import { UserService } from '../../shared/services/user.service';
import { StorageService } from '../../shared/services/storage.service';
import { NbDialogService } from... |
maplecloudy/shopizer-admin | src/app/pages/store-management/models/store.ts | <gh_stars>10-100
export class Store {
id: number;
name: string;
code: string;
retailer: boolean;
} |
maplecloudy/shopizer-admin | src/app/pages/store-management/models/logo.ts | <filename>src/app/pages/store-management/models/logo.ts
export class Logo {
id: number;
name: string;
path: string;
defaultImage: boolean;
externalUrl: string;
imageName: string;
imageType: string;
imageUrl: string;
videoUrl: string;
}
|
maplecloudy/shopizer-admin | src/app/pages/catalogue/options/services/option-value-image.service.ts | <filename>src/app/pages/catalogue/options/services/option-value-image.service.ts
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { CrudService } from '../../../shared/services/crud.service';
@Injectable({
providedIn: 'root'
})
export class OptionValueImageService {
construct... |
maplecloudy/shopizer-admin | src/app/@theme/components/error/error.component.ts | import { Component, OnInit } from '@angular/core';
import { TranslateService } from '@ngx-translate/core';
import { Router } from '@angular/router';
@Component({
selector: 'ngx-error',
templateUrl: './error.component.html',
styleUrls: ['./error.component.scss']
})
export class ErrorComponent implements OnInit {
... |
maplecloudy/shopizer-admin | src/app/pages/tax-management/services/tax.service.ts | import { Injectable } from '@angular/core';
import { HttpClient, HttpParams } from '@angular/common/http';
import { environment } from '../../../../environments/environment';
import { Observable } from 'rxjs';
import { CrudService } from '../../shared/services/crud.service';
@Injectable({
providedIn: 'root'
})
expo... |
maplecloudy/shopizer-admin | src/app/pages/shared/components/image-uploading/image-uploading-adapter.ts | import {
HttpRequest,
HttpClient,
HttpEvent,
HttpEventType
} from "@angular/common/http";
import { catchError, map } from "rxjs/operators";
import { Observable, of } from "rxjs";
import {
FilePickerAdapter,
UploadResponse,
UploadStatus,
FilePreviewModel
} from "ngx-awesome-uploader";
export class Image... |
maplecloudy/shopizer-admin | src/app/@theme/components/image-browser/image-browser.component.ts | <filename>src/app/@theme/components/image-browser/image-browser.component.ts<gh_stars>10-100
import { Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';
import { CrudService } from '../../../pages/shared/services/crud.service';
import { NbDialogRef } from '@nebular/theme';
@Component({
... |
maplecloudy/shopizer-admin | src/app/pages/store-management/store-management.module.ts | <filename>src/app/pages/store-management/store-management.module.ts
import { NgModule } from '@angular/core';
import { StoreManagementComponent } from './store-management.component';
import { SharedModule } from '../shared/shared.module';
import { StoreManagementRoutingModule } from './store-management-routing.module'... |
maplecloudy/shopizer-admin | src/app/pages/payment/payment-routing.module.ts | <gh_stars>10-100
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { PaymentComponent } from './payment.component';
import { PaymentMethodsComponent } from './methods/methods.component';
import { ConfigureComponent } from './configure-form/configure.component';
im... |
maplecloudy/shopizer-admin | src/app/pages/catalogue/products/products-list/products-list.component.ts | <gh_stars>0
import { Component, OnInit } from '@angular/core';
import { ProductService } from '../services/product.service';
import { LocalDataSource } from 'ng2-smart-table';
import { AvailableButtonComponent } from './available-button.component';
import { ShowcaseDialogComponent } from '../../../shared/components/sho... |
maplecloudy/shopizer-admin | src/app/pages/catalogue/catalogues/catalogues-routing.module.ts | <filename>src/app/pages/catalogue/catalogues/catalogues-routing.module.ts
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { CataloguesComponent } from './catalogues.component';
import { CataloguesListComponent } from './catalogues-list/catalogues-list.component'... |
maplecloudy/shopizer-admin | src/app/pages/catalogue/products/services/product-properties.ts | import { Injectable } from '@angular/core';
import { CrudService } from '../../../shared/services/crud.service';
import { Observable } from 'rxjs';
@Injectable({
providedIn: 'root'
})
export class PropertiesService {
constructor(
private crudService: CrudService
) {
}
getProductProperties... |
maplecloudy/shopizer-admin | src/app/pages/catalogue/types/services/types.service.ts | <gh_stars>10-100
import { Injectable } from '@angular/core';
import { CrudService } from '../../../shared/services/crud.service';
import { Observable } from 'rxjs';
import { StorageService } from '../../../shared/services/storage.service';
@Injectable({
providedIn: 'root'
})
export class TypesService {
construct... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.