repo_name stringlengths 5 122 | path stringlengths 3 232 | text stringlengths 6 1.05M |
|---|---|---|
coronsaye/ConstrutNgAdmin | src/app/tests/user.spec.ts | <gh_stars>0
import { User } from '../modules/user/user';
import { UserGroup } from '../models/user-group';
describe('User', () => {
it('should create an instance', () => {
expect(new User('', '', '','',new UserGroup(' ', ' ', ' ', ' '))).toBeTruthy();
});
});
|
coronsaye/ConstrutNgAdmin | src/app/models/normalized-names.ts | export interface NormalizedNames {
}
|
coronsaye/ConstrutNgAdmin | .history/src/app/models/normalized-names_20190625141731.ts | export class NormalizedNames {
}
|
coronsaye/ConstrutNgAdmin | .history/src/app/tests/user-group.spec_20190629212340.ts | import { UserGroup } from '../../models/user-group';
describe('UserGroup', () => {
it('should create an instance', () => {
expect(new UserGroup()).toBeTruthy();
});
});
|
coronsaye/ConstrutNgAdmin | .history/src/app/modules/user-groups/user-groups/user-groups.component_20190617223110.ts | import { Component, OnInit } from '@angular/core';
import { UserGroupService } from '../../../services/user-group.service';
import { UserGroup } from '../user-group';
@Component({
selector: 'app-user-groups',
templateUrl: './user-groups.component.html',
styleUrls: ['./user-groups.component.scss']
})
export clas... |
coronsaye/ConstrutNgAdmin | src/app/modules/user-groups/user-groups-routing.module.ts | <gh_stars>0
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { UserGroupsComponent } from './user-groups/user-groups.component';
import { NewUserGroupComponent } from './new-user-group/new-user-group.component';
const routes: Routes = [
{
path: '',
dat... |
coronsaye/ConstrutNgAdmin | src/app/modules/supplier/supplier.module.ts | <filename>src/app/modules/supplier/supplier.module.ts
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { SuppliersComponent } from './suppliers/suppliers.component';
import { NewSupplierComponent } from './new-supplier/new-supplier.component';
import { ViewSuppierComponen... |
coronsaye/ConstrutNgAdmin | src/app/_nav.ts | <gh_stars>0
export interface NavData {
name?: string;
url?: string;
icon?: string;
badge?: any;
title?: boolean;
children?: any;
variant?: string;
attributes?: object;
divider?: boolean;
class?: string;
}
export const navItems: NavData[] = [
{
title: true,
name: 'Dashboard'
},
{
n... |
coronsaye/ConstrutNgAdmin | .history/src/app/models/fault_20190625142339.ts | <gh_stars>0
export interface Fault {
}
|
coronsaye/ConstrutNgAdmin | .history/src/app/models/error_20190625142316.ts | export interface Error {
}
|
coronsaye/ConstrutNgAdmin | src/app/tests/user-group.spec.ts | <filename>src/app/tests/user-group.spec.ts
import { UserGroup } from '../models/user-group';
describe('UserGroup', () => {
it('should create an instance', () => {
expect(new UserGroup(1, 'name', '2/2/2019', '2/2/2017')).toBeTruthy();
});
});
|
coronsaye/ConstrutNgAdmin | .history/src/app/app-settings_20190617205901.ts |
import { HttpClient, HttpHeaders } from '@angular/common/http';
export class AppSettings {
public static API_ENDPOINT = 'http://localhost:3030/api/v1';
public static HTTP_OPTIONS = { headers: new HttpHeaders({'Content-Type': 'application/json'})};
}
|
coronsaye/ConstrutNgAdmin | src/app/models/fault.ts | <gh_stars>0
export interface Fault {
headers: Headers;
status: number;
statusText: string;
url: string;
ok: boolean;
name: string;
message: string;
error: Error;
}
|
coronsaye/ConstrutNgAdmin | src/app/modules/product/product.module.ts | import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { ProductsComponent } from './products/products.component';
import { NewProductComponent } from './new-product/new-product.component';
import { ReviewsComponent } from './reviews/reviews.component';
import { QoutesComponent... |
coronsaye/ConstrutNgAdmin | src/app/modules/user-groups/new-user-group/new-user-group.component.spec.ts | <reponame>coronsaye/ConstrutNgAdmin
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { NewUserGroupComponent } from './new-user-group.component';
describe('NewUserGroupComponent', () => {
let component: NewUserGroupComponent;
let fixture: ComponentFixture<NewUserGroupComponent>;
... |
coronsaye/ConstrutNgAdmin | src/app/models/error.ts | export interface Error {
isTrusted: boolean;
}
|
coronsaye/ConstrutNgAdmin | src/app/modules/user/user.ts | <gh_stars>0
import { UserGroup } from '../../models/user-group';
export class User {
constructor(
public id,
public username,
public email,
public phone,
public Roles: UserGroup
) { }
}
|
coronsaye/ConstrutNgAdmin | .history/src/app/modules/user-groups/user-groups/user-groups.component_20190625232324.ts | <gh_stars>0
import { Component, OnInit } from '@angular/core';
import { UserGroupService } from '../../../services/user-group.service';
import { UserGroup } from '../user-group';
import Swal from 'sweetalert2';
const swalWithBootstrapButtons = Swal.mixin({
customClass: {
confirmButton: 'btn btn-success',
can... |
coronsaye/ConstrutNgAdmin | .history/src/app/services/user-group.service_20190625151252.ts | import { Injectable } from '@angular/core';
import { UserGroup } from '../modules/user-groups/user-group';
import { AppSettings } from '../app-settings';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Observable, of } from 'rxjs';
import { catchError, map, tap, retry } from 'rxjs/operators';
... |
coronsaye/ConstrutNgAdmin | src/app/modules/user-group-actions/user-group-actions-routing.module.ts | import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { GroupActionsComponent } from './group-actions/group-actions.component';
import { NewGroupActionComponent } from './new-group-action/new-group-action.component';
const routes: Routes = [
{
path: '',
dat... |
coronsaye/ConstrutNgAdmin | .history/src/app/models/headers_20190625142111.ts | export interface Headers {
}
|
coronsaye/ConstrutNgAdmin | src/app/models/headers.ts | import { NormalizedNames } from './normalized-names';
import { Headers2 } from './headers2';
export interface Headers {
normalizedNames: NormalizedNames;
lazyUpdate?: any;
headers: Headers2;
}
|
flash548/mojo.js | src/session.ts | import type {App} from './app.js';
import type {Context} from './context.js';
import crypto from 'crypto';
import {promisify} from 'util';
const scrypt = promisify(crypto.scrypt);
const randomBytes = promisify(crypto.randomBytes);
export class Session {
cookieName = 'mojo';
cookiePath = '/';
expiration = 3600;
... |
flash548/mojo.js | src/mime.ts | import mime from 'mime-types';
const COMMON: Record<string, string> = {
html: 'text/html; charset=utf-8',
json: 'application/json; charset=utf-8',
txt: 'text/plain; charset=utf-8'
};
export class Mime {
detect(accepts: string): string[] {
const types: Record<string, number> = {};
for (const accept of ... |
flash548/mojo.js | src/renderer.ts | <filename>src/renderer.ts
import type {MojoContext, RenderOptions} from './types.js';
import Path from '@mojojs/path';
interface EngineResult {
output: string | Buffer;
format: string;
}
interface ViewSuggestion {
format: string;
engine: string;
path: string;
}
type ViewIndex = Record<string, ViewSuggestion[... |
flash548/mojo.js | src/user-agent.ts | <filename>src/user-agent.ts
import type {UserAgentOptions, UserAgentRequestOptions, UserAgentWebSocketOptions} from './types.js';
import EventEmitter from 'events';
import http from 'http';
import https from 'https';
import Stream from 'stream';
import {format, URL} from 'url';
import {UserAgentResponse} from './user-a... |
flash548/mojo.js | src/plugins/view-helpers.ts | import type {MojoApp, MojoContext, RenderOptions} from '../types.js';
import type {SafeString} from '../util.js';
import type {InspectOptions} from 'util';
import {inspect} from 'util';
import {htmlTag} from '../util.js';
export default function viewHelpersPlugin(app: MojoApp): void {
app.decorateContext('inspect', ... |
flash548/mojo.js | src/plugins/json-config.ts | import type {MojoApp} from '../types.js';
import Path from '@mojojs/path';
export default function jsonConfigPlugin(app: MojoApp, options: {file?: string}): void {
const filename = new Path(options.file ?? 'config.json');
const filePath = filename.isAbsolute() ? filename : app.home.child(filename.toString());
c... |
flash548/mojo.js | src/static.ts | import type {MojoContext} from './types.js';
import crypto from 'crypto';
import path from 'path';
import Path from '@mojojs/path';
export class Static {
prefix = '/public';
publicPaths = [Path.currentFile().sibling('..', 'vendor', 'public').toString()];
async dispatch(ctx: MojoContext): Promise<boolean> {
... |
flash548/mojo.js | src/cli/server.ts | import type {MojoApp} from '../types.js';
import {Server} from '../server.js';
import nopt from 'nopt';
const EVENTS = ['SIGINT', 'SIGTERM', 'SIGUSR2'];
export default async function serverCommand(app: MojoApp, args: string[]): Promise<void> {
const parsed = nopt(
{
cluster: Boolean,
level: String,
... |
flash548/mojo.js | test/support/ts-app/src/plugins/helpers.ts | import type {MojoApp, MojoContext} from '../../../../../lib/types.js';
export default function helpersPlugin(app: MojoApp): void {
app.addHelper('testHelper', testHelper);
}
async function testHelper(ctx: MojoContext, partial: string): Promise<string> {
const language: string = ctx.models.bar.language();
return... |
flash548/mojo.js | src/user-agent/mock.ts | import type {App} from '../app.js';
import type {UserAgentOptions} from '../types.js';
import {Server} from '../server.js';
import {UserAgent} from '../user-agent.js';
export class MockUserAgent extends UserAgent {
server: Server | undefined;
constructor(options?: UserAgentOptions) {
super(options);
this... |
flash548/mojo.js | src/websocket.ts | <filename>src/websocket.ts<gh_stars>0
import type {JSONValue} from './types.js';
import type {UserAgentResponse} from './user-agent/response.js';
import type WS from 'ws';
import EventEmitter, {on} from 'events';
interface WebSocketControlEvents {
close: (...args: any[]) => void;
ping: (...args: any[]) => void;
... |
flash548/mojo.js | src/cli/get.ts | <reponame>flash548/mojo.js
import type {MojoApp} from '../types.js';
import type {ClientRequest, IncomingMessage} from 'http';
import chalk from 'chalk';
import nopt from 'nopt';
type IntrospectedRequest = ClientRequest & {getRawHeaderNames: () => string[]; getHeader: (name: string) => string};
type IntrospectedRespon... |
flash548/mojo.js | src/plugins/ejs-engine.ts | <reponame>flash548/mojo.js
import type {App} from '../app.js';
import type {MojoContext, RenderOptions} from '../types.js';
import type {AsyncTemplateFunction} from 'ejs';
import {createHash} from 'crypto';
import Path from '@mojojs/path';
import {compile} from 'ejs';
import LRU from 'lru-cache';
export default functi... |
flash548/mojo.js | src/server/response.ts | import type {Context} from '../context.js';
import type http from 'http';
import {Stream} from 'stream';
import cookie from 'cookie';
export class ServerResponse {
headers: Record<string, string | string[]> = {};
isSent = false;
raw: http.ServerResponse;
statusCode = 200;
_ctx: WeakRef<Context>;
construct... |
flash548/mojo.js | src/plugins/header-conditions.ts | import type {App} from '../app.js';
import type {MojoContext} from '../types.js';
export default function headerConditionsPlugin(app: App): void {
const router = app.router;
router.addCondition('headers', headerCondition);
router.addCondition('host', hostCondition);
}
function headerCondition(ctx: MojoContext, ... |
flash548/mojo.js | src/cli/eval.ts | import type {MojoApp} from '../types.js';
export default async function evalCommand(app: MojoApp, args: string[]): Promise<void> {
// eslint-disable-next-line no-eval
console.log(eval(args[1]));
}
evalCommand.description = 'Run code against application';
evalCommand.usage = `Usage: APPLICATION eval [OPTIONS] CODE... |
speechly/clothing-store-demo | src/popup.ts | <reponame>speechly/clothing-store-demo
import * as $ from 'jquery';
import {
Client,
ClientState,
Segment,
Word
} from "@speechly/browser-client";
let clientState = ClientState.Disconnected;
let state = {
searchUrl: ""
}
$(function() {
configureApp(process.env.SPEECHLY_APP_ID)
});
function configureAp... |
speechly/clothing-store-demo | src/__tests__/testUrlParsing.ts | import {Segment} from "@speechly/browser-client";
import {getParamsSection,
handleSizeEntities,
handleBrandEntities,
replaceEntityInUrl,
clearFilters
} from "../popup";
test('get params section', () => {
const url = "https://www.asos.com/men/ctas/fashion-online-10/cat/?cid=13517... |
speechly/clothing-store-demo | src/microphone_access.ts | import * as $ from 'jquery';
import {Client} from "@speechly/browser-client";
function initialize(appId: string, statusBar: JQuery<HTMLElement>) {
let client = new Client({
appId: appId,
language: "en-US" // the clothing store demo supports only english at the moment
})
client.initialize((... |
speechly/clothing-store-demo | src/background.ts |
chrome.runtime.onInstalled.addListener((details) => {
if (details.reason.search(/install/g) === -1) {
return
}
chrome.tabs.create({
url: chrome.extension.getURL("welcome.html"),
active: true
})
}) |
speechly/clothing-store-demo | src/content_script.ts | chrome.runtime.onMessage.addListener(function(msg, sender, sendResponse) {
if (msg.error) {
console.log('Receive error = ' + msg.error);
}
if (msg.url && msg.oldUrl) {
console.log('Receive old url = ' + msg.oldUrl);
console.log('Receive url = ' + msg.url);
}
if (msg.seg... |
Lucifer998/TGVCBot | src/types/jiosaavn.response.ts | /**
* Copyright 2021 <NAME> and the Contributors - https://github.com/ArnabXD/TGVCBot/graphs/contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at http://www.apache.org/licenses/L... |
Lucifer998/TGVCBot | src/middlewares/index.ts | <filename>src/middlewares/index.ts
/**
* Copyright 2021 <NAME> and the Contributors - https://github.com/ArnabXD/TGVCBot/graphs/contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License ... |
Lucifer998/TGVCBot | src/types/ytmp3.response.ts | export interface Ytmp3 {
result: boolean;
audio: Audio[];
}
export interface Audio {
itag: number;
mimeType: string;
bitrate: number;
initRange: Range;
indexRange: Range;
lastModified: string;
contentLength: string;
quality: string;
projectionType: string;
averageBitrate: number;
highReplicat... |
Lucifer998/TGVCBot | src/queue.ts | /**
* Copyright 2021 <NAME> and the Contributors - https://github.com/ArnabXD/TGVCBot/graphs/contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at http://www.apache.org/licenses/L... |
Lucifer998/TGVCBot | src/types/chat.ts | /**
* Copyright 2021 <NAME> and the Contributors - https://github.com/ArnabXD/TGVCBot/graphs/contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at http://www.apache.org/licenses/L... |
Lucifer998/TGVCBot | src/handlers/start.ts | <filename>src/handlers/start.ts
/**
* Copyright 2021 <NAME> and the Contributors - https://github.com/ArnabXD/TGVCBot/graphs/contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at... |
mist8kengas/mal-ts | dist/utils/default-fields.d.ts | <gh_stars>0
declare const _default: {
anime: string[];
manga: string[];
};
export default _default;
//# sourceMappingURL=default-fields.d.ts.map |
mist8kengas/mal-ts | src/utils/mal-url.ts | <reponame>mist8kengas/mal-ts
enum API {
V2 = 'https://api.myanimelist.net/v2',
}
enum Type {
Anime = '/anime',
Manga = '/manga',
}
export { API, Type };
export default function malURL(
api: API,
endpoint: Type,
id: string | number,
fields?: string[]
) {
const malURL = new URL(`${api}${e... |
mist8kengas/mal-ts | src/index.ts | import type * as MAL from './types/myanimelist';
import axios from 'axios';
import malURL, { API, Type } from './utils/mal-url.js';
import defaultFields from './utils/default-fields.js';
class MyAnimeList {
private client_id = '';
private request = (url: URL, client_id: string) =>
axios
.g... |
mist8kengas/mal-ts | src/utils/default-fields.ts | export default {
anime: [
'alternative_titles',
'start_date',
'end_date',
'synopsis',
'mean',
'rank',
'popularity',
'num_list_users',
'num_scoring_users',
'nsfw',
'genres',
'created_at',
'updated_at',
'me... |
mist8kengas/mal-ts | dist/utils/mal-url.d.ts | declare enum API {
V2 = "https://api.myanimelist.net/v2"
}
declare enum Type {
Anime = "/anime",
Manga = "/manga"
}
export { API, Type };
export default function malURL(api: API, endpoint: Type, id: string | number, fields?: string[]): URL;
//# sourceMappingURL=mal-url.d.ts.map |
mist8kengas/mal-ts | dist/index.d.ts | import type * as MAL from './types/myanimelist';
declare class MyAnimeList {
private client_id;
private request;
/**
*
* @description Initialize a new MAL wrapper
* @param client_id MAL Client ID
*/
constructor(client_id: string);
/**
* @description Default MAL fields
*... |
mist8kengas/mal-ts | dist/types/myanimelist.d.ts | declare type AnimeField = 'alternative_titles' | 'start_date' | 'end_date' | 'synopsis' | 'mean' | 'rank' | 'popularity' | 'num_list_users' | 'num_scoring_users' | 'nsfw' | 'genres' | 'created_at' | 'updated_at' | 'media_type' | 'status' | 'num_episodes' | 'start_season' | 'broadcast' | 'source' | 'average_episode_dura... |
bahrus/be-persistent | types.d.ts | <reponame>bahrus/be-persistent
import {BeDecoratedProps} from 'be-decorated/types';
export interface BePersistentVirtualProps{
params: PersistenceParams;
}
export interface BePersistentProps extends BePersistentVirtualProps{
proxy: Element & BePersistentVirtualProps;
}
export interface BePersistentActions{
... |
bahrus/be-persistent | be-persistent.ts | <reponame>bahrus/be-persistent
import {define, BeDecoratedProps} from 'be-decorated/be-decorated.js';
import {BePersistentActions, BePersistentProps, BePersistentVirtualProps, PersistenceParams} from './types';
import {register} from 'be-hive/register.js';
import {nudge} from 'trans-render/lib/nudge.js';
import {mergeD... |
johh/notator | src/lib/Sound.ts | import type Timeline from './Timeline';
import Playable, { PlayableProps } from './abstracts/Playable';
interface SoundProps extends PlayableProps {
quantize?: number;
}
export default class Sound extends Playable {
private readonly quantize: number;
constructor({
quantize = 0,
...rest
}: SoundProps ) {
s... |
johh/notator | src/lib/defaults/defaultDestination.ts | import Destination from '../Destination';
import defaultContext from './defaultContext';
const defaultDestination = new Destination({
context: defaultContext,
});
export default defaultDestination;
|
johh/notator | src/lib/Timeline.ts | <filename>src/lib/Timeline.ts<gh_stars>0
import type Part from './Part';
import type Destination from './Destination';
import type Context from './Context';
import type Sound from './Sound';
import type { Effect } from './effects/Effect';
import Bus from './Bus';
import defaultContext from './defaults/defaultContext';
... |
johh/notator | src/lib/Bus.ts | <gh_stars>0
import Node from './abstracts/Node';
import { Effect } from './effects/Effect';
interface BusProps {
effects?: Effect[];
}
export default class Bus extends Node {
private readonly effects: Effect[];
constructor({
effects = [],
}: BusProps ) {
super();
this.effects = effects;
for ( let i = 0... |
johh/notator | src/lib/abstracts/Playable.ts | <filename>src/lib/abstracts/Playable.ts
import type Context from '../Context';
import type Timeline from '../Timeline';
import Source, { Src } from '../Source';
import Container, { ContainerProps } from './Container';
import loadAudio from '../utils/loadAudio';
import defaultContext from '../defaults/defaultContext';
... |
johh/notator | src/lib/effects/Convolver.ts | import type { OperativeNodeProps } from '../abstracts/OperativeNode';
import type { Src } from '../Source';
import EffectNode from './EffectNode';
import loadAudio from '../utils/loadAudio';
interface ConvolverProps extends OperativeNodeProps {
ir: Src;
normalize?: boolean;
}
export default class Convolver extends... |
johh/notator | src/lib/effects/BiquadFilter.ts | <filename>src/lib/effects/BiquadFilter.ts
import type { OperativeNodeProps } from '../abstracts/OperativeNode';
import EffectNode from './EffectNode';
export interface BiquadFilterProps extends OperativeNodeProps {
frequency?: number;
detune?: number;
Q?: number;
gain?: number;
}
interface StaticBiquadFilterProp... |
johh/notator | src/lib/effects/Effect.ts | <gh_stars>0
import type BiquadFilter from './BiquadFilter';
import type Convolver from './Convolver';
import type Delay from './Delay';
import type DynamicsCompressor from './DynamicsCompressor';
import type Gain from './Gain';
export type Effect = BiquadFilter | Convolver | Delay | DynamicsCompressor | Gain;
|
johh/notator | src/lib/abstracts/Container.ts | <gh_stars>0
import type Timeline from '../Timeline';
import type { Effect } from '../effects/Effect';
import Bus from '../Bus';
export interface ContainerProps {
effects?: Effect[];
}
export default abstract class Container {
protected timeline: Timeline;
public readonly bus: Bus;
constructor({
effects = [],... |
johh/notator | src/lib/defaults/defaultContext.ts | import Context from '../Context';
const defaultContext = new Context();
export default defaultContext;
|
johh/notator | src/lib/effects/DynamicsCompressor.ts | import type { OperativeNodeProps } from '../abstracts/OperativeNode';
import EffectNode from './EffectNode';
export interface DynamicsCompressorProps extends OperativeNodeProps{
threshold?: number;
knee?: number;
ratio?: number;
attack?: number;
release?: number;
}
export default class DynamicsCompressor extend... |
johh/notator | src/lib/Part.ts | import type Timeline from './Timeline';
import type Track from './Track';
import Container, { ContainerProps } from './abstracts/Container';
interface PartProps extends ContainerProps {
tracks: Track[];
duration: number;
loop?: boolean;
}
export default class Part extends Container {
private readonly tracks: Tr... |
johh/notator | src/lib/Source.ts | import OperativeNode, { OperativeNodeProps } from './abstracts/OperativeNode';
import loadAudio from './utils/loadAudio';
export type Src = AudioBuffer | ArrayBuffer | string;
interface SourceProps extends OperativeNodeProps {
src?: Src;
gain?: number;
autoDestroy?: boolean;
onAutoDestroy?: () => void;
}
export... |
johh/notator | src/lib/Destination.ts | import OperativeNode, { OperativeNodeProps } from './abstracts/OperativeNode';
export default class Destination extends OperativeNode {
constructor( props: OperativeNodeProps ) {
super( props );
this.context.ready( ctx => {
this.bindNode( ctx.destination );
});
}
// eslint-disable-next-line class-method... |
johh/notator | src/lib/effects/EffectController.ts | <reponame>johh/notator
import type Context from '../Context';
import BiquadFilter, { BiquadFilterProps } from './BiquadFilter';
import Delay, { DelayProps } from './Delay';
import DynamicsCompressor, { DynamicsCompressorProps } from './DynamicsCompressor';
import Gain, { GainProps } from './Gain';
import defaultContext... |
johh/notator | src/lib/effects/EffectNode.ts | import OperativeNode, { OperativeNodeProps } from '../abstracts/OperativeNode';
export default abstract class EffectNode<T extends AudioNode> extends OperativeNode {
public node: T;
constructor( factory: ( ctx: AudioContext ) => T, props: OperativeNodeProps ) {
super( props );
this.context.ready( ( ctx ) => {... |
johh/notator | src/lib/abstracts/OperativeNode.ts | import type Context from '../Context';
import Node from './Node';
import defaultContext from '../defaults/defaultContext';
export interface OperativeNodeProps {
context?: Context;
}
export default abstract class OperativeNode extends Node {
private upstreamNodes: AudioNode[] = [];
protected context: Context;
pub... |
johh/notator | src/lib/abstracts/Node.ts | export default abstract class Node {
private invalidationTimeout: number;
protected autoInvalidateChildren = true;
public parents: Node[] = [];
public children: Node[] = [];
public connect( ...children: Node[]): void {
children.forEach( child => {
if ( !this.children.includes( child ) ) {
child.addParen... |
johh/notator | src/lib/effects/Delay.ts | import type { OperativeNodeProps } from '../abstracts/OperativeNode';
import EffectNode from './EffectNode';
export interface DelayProps extends OperativeNodeProps {
delayTime?: number;
}
export default class Delay extends EffectNode<DelayNode> {
constructor({
delayTime = 0,
...rest
}: DelayProps = {}) {
su... |
johh/notator | src/notator.ts | <gh_stars>0
export { default as defaultContext } from './lib/defaults/defaultContext';
export { default as defaultDestination } from './lib/defaults/defaultDestination';
export { default as Timeline } from './lib/Timeline';
export { default as Track } from './lib/Track';
export { default as Part } from './lib/Part';
e... |
johh/notator | src/lib/effects/Gain.ts | import type { OperativeNodeProps } from '../abstracts/OperativeNode';
import EffectNode from './EffectNode';
export interface GainProps extends OperativeNodeProps {
gain?: number;
}
export default class Gain extends EffectNode<GainNode> {
constructor({
gain = 1,
...rest
}: GainProps = {}) {
super( ( ctx ) =... |
johh/notator | src/lib/Context.ts | <gh_stars>0
declare const webkitAudioContext: typeof AudioContext;
type F = ( ctx: AudioContext ) => void;
export default class Context {
private readyQueue: F[] = [];
private started: Promise<AudioContext>;
public isSafari = typeof AudioContext === 'undefined' && !!webkitAudioContext;
public context: AudioCont... |
johh/notator | src/lib/utils/loadAudio.ts | import type Context from '../Context';
export default function loadAudio(
input: AudioBuffer | ArrayBuffer | string,
context: Context,
): Promise<AudioBuffer> {
return new Promise( ( resolve, reject ) => {
if ( input instanceof AudioBuffer ) {
resolve( input );
} else if ( input instanceof ArrayBuffer ) {
... |
johh/notator | src/lib/Track.ts | <filename>src/lib/Track.ts
import type Part from './Part';
import Playable, { PlayableProps } from './abstracts/Playable';
interface TrackProps extends PlayableProps{
duration: number;
loop?: boolean;
}
export default class Track extends Playable {
public readonly duration: number;
private readonly loop: boolea... |
nakatamaho/qni | packages/common/src/detailed-error.ts | /**
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... |
nakatamaho/qni | packages/elements/src/mixin/hoverable.ts | import {Constructor} from './constructor'
export declare class Hoverable {
get hoverable(): boolean
set hoverable(value: boolean)
}
export function HoverableMixin<TBase extends Constructor<HTMLElement>>(Base: TBase): Constructor<Hoverable> & TBase {
class HoverableMixinClass extends Base {
get hoverable(): ... |
nakatamaho/qni | packages/simulator/test/simulator.ts | <gh_stars>10-100
import {Matrix, Simulator, StateVector} from '../src'
import {Complex} from '@qni/common'
QUnit.module('Simulator', () => {
QUnit.module('.write', () => {
QUnit.test('|0>.write(0, 0) should be |0>', assert => {
const simulator = new Simulator('0')
assert.equates(simulator.write(0, 0)... |
nakatamaho/qni | packages/elements/src/mixin/controllable.ts | <reponame>nakatamaho/qni<gh_stars>10-100
import {Constructor} from './constructor'
export declare class Controllable {
set controls(value: number[])
get controls(): number[]
get isControlled(): boolean
}
export const isControllable = (arg: unknown): arg is Controllable =>
typeof arg === 'object' && arg !== nu... |
nakatamaho/qni | packages/elements/src/mixin/ifable.ts | <reponame>nakatamaho/qni<gh_stars>10-100
import {Constructor} from './constructor'
import {attr} from '@github/catalyst'
export declare class Ifable {
get if(): string
set if(value: string)
}
export const isIfable = (arg: unknown): arg is Ifable =>
typeof arg === 'object' && arg !== null && typeof (arg as Ifabl... |
nakatamaho/qni | packages/elements/src/mixin/helpable.ts | import {Interpreter, createMachine, interpret} from 'xstate'
import tippy, {Instance, roundArrow} from 'tippy.js'
import {Constructor} from './constructor'
import {attr} from '@github/catalyst'
import {describe} from '@qni/common'
export declare class Helpable {
initHelp(): void
showHelp(): void
disableHelp(): v... |
nakatamaho/qni | packages/common/src/measurement-gate.ts | export const SerializedMeasurementGateType = 'Measure'
export type SerializedMeasurementGate = {
type: typeof SerializedMeasurementGateType
targets: number[]
flag?: string
}
|
nakatamaho/qni | packages/common/src/equate.ts | /**
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... |
nakatamaho/qni | packages/simulator/test/matrix.ts | <reponame>nakatamaho/qni
import {Complex, Format} from '@qni/common'
import {Matrix} from '../src/matrix'
QUnit.module('Matrix', () => {
QUnit.test('isEqualTo', assert => {
const m = Matrix.fromRows([
[new Complex(2, 3), new Complex(5, 7)],
[new Complex(11, 13), new Complex(17, 19)]
])
assert... |
nakatamaho/qni | packages/common/src/write-gate.ts | export const SerializedWrite0GateType = '|0>'
export const SerializedWrite1GateType = '|1>'
export type SerializedWriteGate = {
type: typeof SerializedWrite0GateType | typeof SerializedWrite1GateType
targets: number[]
}
|
nakatamaho/qni | packages/common/src/y-gate.ts | <filename>packages/common/src/y-gate.ts
export const SerializedYGateType = 'Y'
export type SerializedYGate = {
type: typeof SerializedYGateType
targets: number[]
controls?: number[]
if?: string
}
|
nakatamaho/qni | packages/elements/src/index.ts | export * from './operation'
export * from './util'
export * from './mixin/angleable'
export * from './mixin/constructor'
export * from './mixin/flaggable'
export * from './mixin/ifable'
export * from './inspector-button-element'
export * from './operation-inspector-element'
export * from './angle-slider-element'
expo... |
nakatamaho/qni | packages/common/src/angle-parser.ts | import Fraction from 'fraction.js'
export function radian(angle: string): number {
const coefficient = piCoefficient(angle)
const fraction = new Fraction(coefficient).valueOf()
return fraction * Math.PI
}
export function angleDenominator(angle: string): number {
const coefficient = piCoefficient(angle)
con... |
nakatamaho/qni | packages/elements/src/mixin/activateable.ts | import {Constructor} from './constructor'
export declare class Activateable {
get active(): boolean
set active(value: boolean)
}
export function ActivateableMixin<TBase extends Constructor<HTMLElement>>(
Base: TBase
): Constructor<Activateable> & TBase {
class ActivateableMixinClass extends Base {
get act... |
nakatamaho/qni | apps/www/app/javascript/controllers/menu_controller.ts | <reponame>nakatamaho/qni<filename>apps/www/app/javascript/controllers/menu_controller.ts
import {Controller} from '@hotwired/stimulus'
export default class MenuController extends Controller {
static values = {activeClass: String}
static targets = ['button', 'dropdown']
declare activeClassValue: string
declare... |
nakatamaho/qni | packages/elements/src/y-gate-element.ts | <gh_stars>10-100
import {
ActivateableMixin,
DisableableMixin,
DraggableMixin,
HelpableMixin,
HoverableMixin,
IconableMixin,
IfableMixin,
MenuableMixin
} from './mixin/'
import {html, render} from '@github/jtml'
import {ControllableMixin} from './mixin/controllable'
import {SerializedYGateType} from '@q... |
nakatamaho/qni | packages/common/src/describe.ts | /**
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... |
nakatamaho/qni | apps/www/app/javascript/controllers/clipboard_controller.ts | import tippy, {Instance, roundArrow} from 'tippy.js'
import {Controller} from '@hotwired/stimulus'
export default class ClipboardController extends Controller {
private popup!: Instance
connect(): void {
this.popup = tippy(this.element, {
arrow: roundArrow + roundArrow,
content: 'Copied to clipboa... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.