type stringclasses 7
values | content stringlengths 4 9.55k | repo stringlengths 7 96 | path stringlengths 4 178 | language stringclasses 1
value |
|---|---|---|---|---|
MethodDeclaration | // Async function to start video stream.
async start(): Promise<void> {
if (this.webcamConfig.facingMode) {
assert(
(this.webcamConfig.facingMode === 'user') ||
(this.webcamConfig.facingMode === 'environment'),
() =>
`Invalid webcam facing mode: ${this.webcamCon... | crypt096/crypt0-face-manipulation-app | node_modules/@tensorflow/tfjs-data/src/iterators/webcam_iterator.ts | TypeScript |
MethodDeclaration |
async next(): Promise<IteratorResult<Tensor3D>> {
if (this.isClosed) {
return {value: null, done: true};
}
let img;
try {
img = browser.fromPixels(this.webcamVideoElement);
} catch (e) {
throw new Error(
`Error thrown converting video to pixels: ${JSON.stringify(e)}`);
... | crypt096/crypt0-face-manipulation-app | node_modules/@tensorflow/tfjs-data/src/iterators/webcam_iterator.ts | TypeScript |
MethodDeclaration |
private needToResize() {
// If resizeWidth and resizeHeight are provided, and different from the
// width and height of original HTMLVideoElement, then resizing and cropping
// is required.
if (this.webcamConfig.resizeWidth && this.webcamConfig.resizeHeight &&
(this.webcamVideoElement.width !==... | crypt096/crypt0-face-manipulation-app | node_modules/@tensorflow/tfjs-data/src/iterators/webcam_iterator.ts | TypeScript |
MethodDeclaration | // Cropping and resizing each frame based on config
cropAndResizeFrame(img: Tensor3D): Tensor3D {
const expandedImage: Tensor4D = img.toFloat().expandDims(0);
let resizedImage;
resizedImage = image.cropAndResize(
expandedImage, this.cropBox, this.cropBoxInd, this.cropSize,
'bilinear');
/... | crypt096/crypt0-face-manipulation-app | node_modules/@tensorflow/tfjs-data/src/iterators/webcam_iterator.ts | TypeScript |
MethodDeclaration | // Capture one frame from the video stream, and extract the value from
// iterator.next() result.
async capture(): Promise<Tensor3D> {
return (await this.next()).value;
} | crypt096/crypt0-face-manipulation-app | node_modules/@tensorflow/tfjs-data/src/iterators/webcam_iterator.ts | TypeScript |
MethodDeclaration | // Stop the video stream and pause webcam iterator.
stop(): void {
const tracks = this.stream.getTracks();
tracks.forEach(track => track.stop());
try {
this.webcamVideoElement.srcObject = null;
} catch (error) {
console.log(error);
this.webcamVideoElement.src = null;
}
this.i... | crypt096/crypt0-face-manipulation-app | node_modules/@tensorflow/tfjs-data/src/iterators/webcam_iterator.ts | TypeScript |
MethodDeclaration | // Override toArray() function to prevent collecting.
toArray(): Promise<Tensor3D[]> {
throw new Error('Can not convert infinite video stream to array.');
} | crypt096/crypt0-face-manipulation-app | node_modules/@tensorflow/tfjs-data/src/iterators/webcam_iterator.ts | TypeScript |
ClassDeclaration |
export class ObjectRegistry {
public static doDebug = false;
public static registries: any = gRegistries;
private _objectType: any;
private readonly _cache: any;
constructor(objectType?: any) {
this._objectType = objectType;
this._cache = {};
gRegistries.push(this);
}
... | MarcoSeb/node-opcua | packages/node-opcua-object-registry/source/objectRegistry.ts | TypeScript |
MethodDeclaration |
public getClassName(): string {
return this._objectType ? this._objectType.name : "<???>";
} | MarcoSeb/node-opcua | packages/node-opcua-object-registry/source/objectRegistry.ts | TypeScript |
MethodDeclaration |
public register(obj: any): void {
if (!this._objectType) {
this._objectType = obj.constructor;
}
if (!obj._____hash) {
obj._____hash = hashCounter;
hashCounter += 1;
this._cache[obj._____hash] = obj;
}
// istanbul ignore next
... | MarcoSeb/node-opcua | packages/node-opcua-object-registry/source/objectRegistry.ts | TypeScript |
MethodDeclaration |
public unregister(obj: any): void {
this._cache[obj._____hash] = null;
obj._____trace = null;
delete this._cache[obj._____hash];
} | MarcoSeb/node-opcua | packages/node-opcua-object-registry/source/objectRegistry.ts | TypeScript |
MethodDeclaration |
public count(): number {
return Object.keys(this._cache).length;
} | MarcoSeb/node-opcua | packages/node-opcua-object-registry/source/objectRegistry.ts | TypeScript |
MethodDeclaration |
public toString(): string {
const className = this.getClassName();
let str = " className :" + className + " found => " + this.count() + " object leaking\n";
for (const obj of Object.values(this._cache) as any[]) {
str += obj.constructor.name + " " + obj.toString() + "\n";
}... | MarcoSeb/node-opcua | packages/node-opcua-object-registry/source/objectRegistry.ts | TypeScript |
ArrowFunction |
() => {
const httpClient = useHttpClient();
return useQuery(QUERY_KEYS.getRoles, async () => {
const response = await httpClient.get<RoleResponseListData>('roles');
return response.data.data;
});
} | tericcabrel/tech-career-growth | src/hooks/request/query/use-retrieve-roles.ts | TypeScript |
ArrowFunction |
async () => {
const response = await httpClient.get<RoleResponseListData>('roles');
return response.data.data;
} | tericcabrel/tech-career-growth | src/hooks/request/query/use-retrieve-roles.ts | TypeScript |
ArrowFunction |
() => {
this.SliderChange();
} | NTaylorMullen/EndGate | EndGate/samples/EndGate.Core.JS.Samples/Content/Samples/Particles/CustomSlider.ts | TypeScript |
ClassDeclaration |
export class CustomSlider {
constructor(private _target: any, private _min: number, private _max: number, private _defaultValue: number, private _onSliderChange: Function) {
var sliderChange = () => {
this.SliderChange();
};
// Build slider with default val... | NTaylorMullen/EndGate | EndGate/samples/EndGate.Core.JS.Samples/Content/Samples/Particles/CustomSlider.ts | TypeScript |
MethodDeclaration | // Take an outside value and update the slider (this is used for things like animating)
public UpdateSlider(val: number): void {
this._target.slider("value", val);
} | NTaylorMullen/EndGate | EndGate/samples/EndGate.Core.JS.Samples/Content/Samples/Particles/CustomSlider.ts | TypeScript |
MethodDeclaration |
private SliderChange(): void {
this._onSliderChange(parseInt(this._target.slider("value")));
} | NTaylorMullen/EndGate | EndGate/samples/EndGate.Core.JS.Samples/Content/Samples/Particles/CustomSlider.ts | TypeScript |
ArrowFunction |
() => {
let component: OverlayComponent;
let fixture: ComponentFixture<OverlayComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [OverlayComponent],
providers: [Overlay]
})
.compileComponents();
});
beforeEach(() => {
fixture ... | LPoeppel/windpark_project_webapp | frontend/src/app/components/overlay/overlay.component.spec.ts | TypeScript |
ArrowFunction |
async () => {
await TestBed.configureTestingModule({
declarations: [OverlayComponent],
providers: [Overlay]
})
.compileComponents();
} | LPoeppel/windpark_project_webapp | frontend/src/app/components/overlay/overlay.component.spec.ts | TypeScript |
ArrowFunction |
() => {
fixture = TestBed.createComponent(OverlayComponent);
component = fixture.componentInstance;
fixture.detectChanges();
} | LPoeppel/windpark_project_webapp | frontend/src/app/components/overlay/overlay.component.spec.ts | TypeScript |
ArrowFunction |
() => {
expect(component).toBeTruthy();
} | LPoeppel/windpark_project_webapp | frontend/src/app/components/overlay/overlay.component.spec.ts | TypeScript |
ArrowFunction |
() => {
component.createGlobalOverlay();
} | LPoeppel/windpark_project_webapp | frontend/src/app/components/overlay/overlay.component.spec.ts | TypeScript |
ArrowFunction |
paramMap => {
if (paramMap.has('placeId')) {
this._placesService.getPlaceAPIObservable(paramMap.get('placeId')).subscribe(data => {
let thisPlace = { id: data.id, ...(data.data() as {}) } as Place;
this.createEditForm(thisPlace);
});
}
} | mihai10001/reservation_system_v2 | reservation_system/src/app/main-layout/pages/admin-places/add-edit-place/add-edit-place.component.ts | TypeScript |
ArrowFunction |
data => {
let thisPlace = { id: data.id, ...(data.data() as {}) } as Place;
this.createEditForm(thisPlace);
} | mihai10001/reservation_system_v2 | reservation_system/src/app/main-layout/pages/admin-places/add-edit-place/add-edit-place.component.ts | TypeScript |
ArrowFunction |
checkbox => checkbox.nativeElement.innerHTML[0] === i && checkbox.nativeElement.innerHTML[2] === j | mihai10001/reservation_system_v2 | reservation_system/src/app/main-layout/pages/admin-places/add-edit-place/add-edit-place.component.ts | TypeScript |
ArrowFunction |
checkbox => checkbox.nativeElement.checked = true | mihai10001/reservation_system_v2 | reservation_system/src/app/main-layout/pages/admin-places/add-edit-place/add-edit-place.component.ts | TypeScript |
ArrowFunction |
val => {
this.nrRows.next([...Array(val)]);
} | mihai10001/reservation_system_v2 | reservation_system/src/app/main-layout/pages/admin-places/add-edit-place/add-edit-place.component.ts | TypeScript |
ArrowFunction |
val => {
this.nrCols.next([...Array(val)]);
} | mihai10001/reservation_system_v2 | reservation_system/src/app/main-layout/pages/admin-places/add-edit-place/add-edit-place.component.ts | TypeScript |
ArrowFunction |
checkbox => checkbox.nativeElement.checked | mihai10001/reservation_system_v2 | reservation_system/src/app/main-layout/pages/admin-places/add-edit-place/add-edit-place.component.ts | TypeScript |
ArrowFunction |
checkbox => {
const i = checkbox.nativeElement.innerHTML[0];
const j = checkbox.nativeElement.innerHTML[2];
return {i, j};
} | mihai10001/reservation_system_v2 | reservation_system/src/app/main-layout/pages/admin-places/add-edit-place/add-edit-place.component.ts | TypeScript |
ArrowFunction |
(data) => this.router.navigateByUrl('/admin-places') | mihai10001/reservation_system_v2 | reservation_system/src/app/main-layout/pages/admin-places/add-edit-place/add-edit-place.component.ts | TypeScript |
ClassDeclaration |
@Component({
selector: 'app-add-edit-place',
templateUrl: './add-edit-place.component.html',
styleUrls: ['./add-edit-place.component.scss'],
})
export class AdminAddEditPlaceComponent implements OnInit, AfterViewInit {
addEditPlaceForm;
addOrEdit: 'add' | 'edit' | null = null;
nrRows: BehaviorSubject<numb... | mihai10001/reservation_system_v2 | reservation_system/src/app/main-layout/pages/admin-places/add-edit-place/add-edit-place.component.ts | TypeScript |
MethodDeclaration |
ngOnInit() {
this.createAddForm();
} | mihai10001/reservation_system_v2 | reservation_system/src/app/main-layout/pages/admin-places/add-edit-place/add-edit-place.component.ts | TypeScript |
MethodDeclaration |
ngAfterViewInit() {
this.activatedRoute.paramMap.subscribe(paramMap => {
if (paramMap.has('placeId')) {
this._placesService.getPlaceAPIObservable(paramMap.get('placeId')).subscribe(data => {
let thisPlace = { id: data.id, ...(data.data() as {}) } as Place;
this.createEditForm(this... | mihai10001/reservation_system_v2 | reservation_system/src/app/main-layout/pages/admin-places/add-edit-place/add-edit-place.component.ts | TypeScript |
MethodDeclaration |
createAddForm() {
this.addOrEdit = 'add';
this.addEditPlaceForm = this.formBuilder.group({
title: ['', Validators.required],
description: ['', [Validators.required, Validators.maxLength(200)]],
schedule: ['', Validators.required],
imageUrl: ['', Validators.required],
openDays:
... | mihai10001/reservation_system_v2 | reservation_system/src/app/main-layout/pages/admin-places/add-edit-place/add-edit-place.component.ts | TypeScript |
MethodDeclaration |
createEditForm(thisPlace: Place) {
this.addOrEdit = 'edit';
this.nrRows.next([...Array(thisPlace.availableGridRows)]);
this.nrCols.next([...Array(thisPlace.availableGridCols)]);
this.ref.detectChanges();
this.addEditPlaceForm = this.formBuilder.group({
id: [thisPlace.id, Validators.required]... | mihai10001/reservation_system_v2 | reservation_system/src/app/main-layout/pages/admin-places/add-edit-place/add-edit-place.component.ts | TypeScript |
MethodDeclaration |
onGridValueChanges() {
this.addEditPlaceForm?.controls.availableGridRows.valueChanges.subscribe( val => {
this.nrRows.next([...Array(val)]);
});
this.addEditPlaceForm?.controls.availableGridCols.valueChanges.subscribe( val => {
this.nrCols.next([...Array(val)]);
});
} | mihai10001/reservation_system_v2 | reservation_system/src/app/main-layout/pages/admin-places/add-edit-place/add-edit-place.component.ts | TypeScript |
MethodDeclaration |
onAddOrEditPlace() {
if(this.addEditPlaceForm.invalid || !this.addOrEdit)
{
return;
}
// This should be separate function !
this.addEditPlaceForm.value.availableSeats = this.checkboxes
.filter(checkbox => checkbox.nativeElement.checked)
.map(checkbox => {
const i = chec... | mihai10001/reservation_system_v2 | reservation_system/src/app/main-layout/pages/admin-places/add-edit-place/add-edit-place.component.ts | TypeScript |
ArrowFunction |
({ isStrikethrough }) => (isStrikethrough ? 0.3 : 1) | mechamobau/netshoes-challenge-frontend | packages/web/src/components/molecules/ProductListItem/ProductListItem.tsx | TypeScript |
ArrowFunction |
({ isStrikethrough }) =>
isStrikethrough ? 'line-through' : 'normal' | mechamobau/netshoes-challenge-frontend | packages/web/src/components/molecules/ProductListItem/ProductListItem.tsx | TypeScript |
ArrowFunction |
({ product }: Props) => {
const [removeButtonHovered, setRemoveButtonHovered] = useState(false);
const [productHovered, setProductHovered] = useState(false);
const { removeProductFromCart } = useCart();
const setTrue = useCallback(
(callback: (value: boolean) => void) => () => {
callback(true);
... | mechamobau/netshoes-challenge-frontend | packages/web/src/components/molecules/ProductListItem/ProductListItem.tsx | TypeScript |
ArrowFunction |
(callback: (value: boolean) => void) => () => {
callback(true);
} | mechamobau/netshoes-challenge-frontend | packages/web/src/components/molecules/ProductListItem/ProductListItem.tsx | TypeScript |
ArrowFunction |
() => {
callback(true);
} | mechamobau/netshoes-challenge-frontend | packages/web/src/components/molecules/ProductListItem/ProductListItem.tsx | TypeScript |
ArrowFunction |
(callback: (value: boolean) => void) => () => {
callback(false);
} | mechamobau/netshoes-challenge-frontend | packages/web/src/components/molecules/ProductListItem/ProductListItem.tsx | TypeScript |
ArrowFunction |
() => {
callback(false);
} | mechamobau/netshoes-challenge-frontend | packages/web/src/components/molecules/ProductListItem/ProductListItem.tsx | TypeScript |
ArrowFunction |
() => removeProductFromCart(product.id) | mechamobau/netshoes-challenge-frontend | packages/web/src/components/molecules/ProductListItem/ProductListItem.tsx | TypeScript |
TypeAliasDeclaration |
type Props = {
product: ProductCart;
}; | mechamobau/netshoes-challenge-frontend | packages/web/src/components/molecules/ProductListItem/ProductListItem.tsx | TypeScript |
MethodDeclaration |
setTrue(setProductHovered) | mechamobau/netshoes-challenge-frontend | packages/web/src/components/molecules/ProductListItem/ProductListItem.tsx | TypeScript |
MethodDeclaration |
setFalse(setProductHovered) | mechamobau/netshoes-challenge-frontend | packages/web/src/components/molecules/ProductListItem/ProductListItem.tsx | TypeScript |
MethodDeclaration |
setTrue(setRemoveButtonHovered) | mechamobau/netshoes-challenge-frontend | packages/web/src/components/molecules/ProductListItem/ProductListItem.tsx | TypeScript |
MethodDeclaration |
setFalse(setRemoveButtonHovered) | mechamobau/netshoes-challenge-frontend | packages/web/src/components/molecules/ProductListItem/ProductListItem.tsx | TypeScript |
ClassDeclaration |
export class CardView extends BaseImageCardView<IHybridWorkCheckinAdaptiveCardExtensionProps, IHybridWorkCheckinAdaptiveCardExtensionState> {
/**
* Buttons will not be visible if card size is 'Medium' with Image Card View.
* It will support up to two buttons for 'Large' card size.
*/
public get cardButton... | ArijitCloud/sp-dev-fx-aces | samples/ImageCard-HybridWork-Checkin/src/adaptiveCardExtensions/hybridWorkCheckin/cardView/CardView.ts | TypeScript |
ArrowFunction |
() => import(/* webpackChunkName: "about" */ '@/views/About.vue') | npuserauth/npuer-sample | npuser-sample-client/src/router/index.ts | TypeScript |
ArrowFunction |
() => import(/* webpackChunkName: "account" */ '@/views/Account.vue') | npuserauth/npuer-sample | npuser-sample-client/src/router/index.ts | TypeScript |
ArrowFunction |
() => import(/* webpackChunkName: "auth" */ '@/npuser-auth/Auth.vue') | npuserauth/npuer-sample | npuser-sample-client/src/router/index.ts | TypeScript |
ArrowFunction |
() => import(/* webpackChunkName: "dashboard" */ '@/views/UserDash.vue') | npuserauth/npuer-sample | npuser-sample-client/src/router/index.ts | TypeScript |
ArrowFunction |
(to, from, next) => {
if (to.matched.some(record => record.meta.requiresAuth)) {
// this route requires auth, check if logged in ... if not, redirect to login page.
if (!authenticated()) {
next({
path: '/auth',
query: { redirect: to.fullPath }
})
return
}
}
// make s... | npuserauth/npuer-sample | npuser-sample-client/src/router/index.ts | TypeScript |
ArrowFunction |
record => record.meta.requiresAuth | npuserauth/npuer-sample | npuser-sample-client/src/router/index.ts | TypeScript |
ArrowFunction |
(item: any) => {
item.healthState = item.health.state
? item.health.state === 'healthy'
? 'Up'
: item.health.state === 'unknown'
? 'Unknown'
: 'Down'
: 'Down';
} | chen5260056/deck | app/scripts/modules/alicloud/src/loadBalancer/loadBalancer.transformer.ts | TypeScript |
ClassDeclaration |
export class AlicloudLoadBalancerTransformer {
public static $inject = ['$q'];
constructor(private $q: IQService) {}
public normalizeLoadBalancer(loadBalancer: any): any {
loadBalancer.serverGroups.forEach(function(serverGroup: any) {
serverGroup.account = loadBalancer.account;
serverGroup.region... | chen5260056/deck | app/scripts/modules/alicloud/src/loadBalancer/loadBalancer.transformer.ts | TypeScript |
MethodDeclaration |
public normalizeLoadBalancer(loadBalancer: any): any {
loadBalancer.serverGroups.forEach(function(serverGroup: any) {
serverGroup.account = loadBalancer.account;
serverGroup.region = loadBalancer.region;
if (serverGroup.detachedInstances) {
serverGroup.detachedInstances = serverGroup.deta... | chen5260056/deck | app/scripts/modules/alicloud/src/loadBalancer/loadBalancer.transformer.ts | TypeScript |
MethodDeclaration |
public convertLoadBalancerForEditing(loadBalancer: any) {
const toEdit: any = {
region: loadBalancer.region,
credentials: loadBalancer.account,
name: loadBalancer.name,
stack: loadBalancer.stack,
detail: loadBalancer.detail,
vnet: loadBalancer.vnet,
masterZoneId: loadBalan... | chen5260056/deck | app/scripts/modules/alicloud/src/loadBalancer/loadBalancer.transformer.ts | TypeScript |
MethodDeclaration |
public constructNewLoadBalancerTemplate(application: any) {
const defaultCredentials: string =
application.defaultCredentials.alicloud || AliCloudProviderSettings.defaults.account,
defaultRegion: string = application.defaultRegions.alicloud || AliCloudProviderSettings.defaults.region;
return {
... | chen5260056/deck | app/scripts/modules/alicloud/src/loadBalancer/loadBalancer.transformer.ts | TypeScript |
ArrowFunction |
(
subject: string,
options: {
name?: string;
email?: string;
labels?: string[];
username?: string;
packages?: string[];
} = {}
): IExtendedCommit => ({
hash: 'foo',
labels: options.labels || [],
authorName: options.name || 'Adam Dierkens',
authorEmail: options.email || 'adam@dierkens.... | orta/auto-release | src/__tests__/make-commit-from-msg.ts | TypeScript |
ArrowFunction |
() => {
render(<CustomRenderer />)
} | commitd/components-incubating | src/components/Graph/Graph.test.tsx | TypeScript |
FunctionDeclaration | // ngx-translate - required for AOT compilation
export function HttpLoaderFactory(http: HttpClient) {
return new TranslateHttpLoader(http);
} | Coding-c/portal-angular-js | src/app/shared/modules/language-translation/language-translation.module.ts | TypeScript |
ClassDeclaration |
@NgModule({
declarations: [],
imports: [
TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
useFactory: HttpLoaderFactory,
deps: [HttpClient]
}
})
],
exports: [
TranslateModule
],
})
export class LanguageTranslationModule {
construc... | Coding-c/portal-angular-js | src/app/shared/modules/language-translation/language-translation.module.ts | TypeScript |
ClassDeclaration |
@Entity()
export class Contact{
@ObjectIdColumn()
id: string;
@Column()
name:string;
@Column()
workId:string
@Column()
department:string
} | nazir021/nest-api | src/Contact/contact.entity.ts | TypeScript |
ArrowFunction |
() => {
let appController: AppController;
beforeEach(async () => {
const app: TestingModule = await Test.createTestingModule({
controllers: [AppController],
providers: [AppService]
}).compile();
appController = app.get<AppController>(AppController);
});
... | RadarRadarRadar/memeLord | src/app.controller.spec.ts | TypeScript |
ArrowFunction |
async () => {
const app: TestingModule = await Test.createTestingModule({
controllers: [AppController],
providers: [AppService]
}).compile();
appController = app.get<AppController>(AppController);
} | RadarRadarRadar/memeLord | src/app.controller.spec.ts | TypeScript |
ArrowFunction |
() => {
it('should exist', () => {
expect(appController).toBeDefined();
});
} | RadarRadarRadar/memeLord | src/app.controller.spec.ts | TypeScript |
ArrowFunction |
() => {
expect(appController).toBeDefined();
} | RadarRadarRadar/memeLord | src/app.controller.spec.ts | TypeScript |
ArrowFunction |
() => {
const [position, setPosition] = useState({x: 0, y: 0 })
useEffect(() => {
const updateMouse = (e:any) => {
setPosition({ x: e.clientX, y: e.clientY })
}
document.addEventListener('mousemove', updateMouse)
return () => {
document.removeEventListene... | King-LJQ/moderate-react-template | src/common/hooks/useMousePostion.tsx | TypeScript |
ArrowFunction |
() => {
const updateMouse = (e:any) => {
setPosition({ x: e.clientX, y: e.clientY })
}
document.addEventListener('mousemove', updateMouse)
return () => {
document.removeEventListener('mousemove', updateMouse)
}
} | King-LJQ/moderate-react-template | src/common/hooks/useMousePostion.tsx | TypeScript |
ArrowFunction |
(e:any) => {
setPosition({ x: e.clientX, y: e.clientY })
} | King-LJQ/moderate-react-template | src/common/hooks/useMousePostion.tsx | TypeScript |
ArrowFunction |
() => {
document.removeEventListener('mousemove', updateMouse)
} | King-LJQ/moderate-react-template | src/common/hooks/useMousePostion.tsx | TypeScript |
ArrowFunction |
(ws) => ws.registerExpress(app) | maramih/cactus | packages/cactus-plugin-ledger-connector-quorum/src/main/typescript/plugin-ledger-connector-quorum.ts | TypeScript |
InterfaceDeclaration |
export interface IPluginLedgerConnectorQuorumOptions
extends ICactusPluginOptions {
rpcApiHttpHost: string;
logLevel?: LogLevelDesc;
prometheusExporter?: PrometheusExporter;
pluginRegistry: PluginRegistry;
} | maramih/cactus | packages/cactus-plugin-ledger-connector-quorum/src/main/typescript/plugin-ledger-connector-quorum.ts | TypeScript |
MethodDeclaration |
public getPrometheusExporter(): PrometheusExporter {
return this.prometheusExporter;
} | maramih/cactus | packages/cactus-plugin-ledger-connector-quorum/src/main/typescript/plugin-ledger-connector-quorum.ts | TypeScript |
MethodDeclaration |
public async getPrometheusExporterMetrics(): Promise<string> {
const res: string = await this.prometheusExporter.getPrometheusMetrics();
this.log.debug(`getPrometheusExporterMetrics() response: %o`, res);
return res;
} | maramih/cactus | packages/cactus-plugin-ledger-connector-quorum/src/main/typescript/plugin-ledger-connector-quorum.ts | TypeScript |
MethodDeclaration |
public getInstanceId(): string {
return this.instanceId;
} | maramih/cactus | packages/cactus-plugin-ledger-connector-quorum/src/main/typescript/plugin-ledger-connector-quorum.ts | TypeScript |
MethodDeclaration |
public getHttpServer(): Optional<Server | SecureServer> {
return Optional.ofNullable(this.httpServer);
} | maramih/cactus | packages/cactus-plugin-ledger-connector-quorum/src/main/typescript/plugin-ledger-connector-quorum.ts | TypeScript |
MethodDeclaration |
public async shutdown(): Promise<void> {
const serverMaybe = this.getHttpServer();
if (serverMaybe.isPresent()) {
const server = serverMaybe.get();
await promisify(server.close.bind(server))();
}
} | maramih/cactus | packages/cactus-plugin-ledger-connector-quorum/src/main/typescript/plugin-ledger-connector-quorum.ts | TypeScript |
MethodDeclaration |
public async onPluginInit(): Promise<unknown> {
return;
} | maramih/cactus | packages/cactus-plugin-ledger-connector-quorum/src/main/typescript/plugin-ledger-connector-quorum.ts | TypeScript |
MethodDeclaration |
async registerWebServices(app: Express): Promise<IWebServiceEndpoint[]> {
const webServices = await this.getOrCreateWebServices();
await Promise.all(webServices.map((ws) => ws.registerExpress(app)));
return webServices;
} | maramih/cactus | packages/cactus-plugin-ledger-connector-quorum/src/main/typescript/plugin-ledger-connector-quorum.ts | TypeScript |
MethodDeclaration |
public async getOrCreateWebServices(): Promise<IWebServiceEndpoint[]> {
if (Array.isArray(this.endpoints)) {
return this.endpoints;
}
const endpoints: IWebServiceEndpoint[] = [];
{
const endpoint = new DeployContractSolidityBytecodeEndpoint({
connector: this,
logLevel: this.... | maramih/cactus | packages/cactus-plugin-ledger-connector-quorum/src/main/typescript/plugin-ledger-connector-quorum.ts | TypeScript |
MethodDeclaration |
public getPackageName(): string {
return `@hyperledger/cactus-plugin-ledger-connector-quorum`;
} | maramih/cactus | packages/cactus-plugin-ledger-connector-quorum/src/main/typescript/plugin-ledger-connector-quorum.ts | TypeScript |
MethodDeclaration |
public async getConsensusAlgorithmFamily(): Promise<
ConsensusAlgorithmFamily
> {
return ConsensusAlgorithmFamily.Authority;
} | maramih/cactus | packages/cactus-plugin-ledger-connector-quorum/src/main/typescript/plugin-ledger-connector-quorum.ts | TypeScript |
MethodDeclaration |
public async hasTransactionFinality(): Promise<boolean> {
const currentConsensusAlgorithmFamily = await this.getConsensusAlgorithmFamily();
return consensusHasTransactionFinality(currentConsensusAlgorithmFamily);
} | maramih/cactus | packages/cactus-plugin-ledger-connector-quorum/src/main/typescript/plugin-ledger-connector-quorum.ts | TypeScript |
MethodDeclaration |
public async invokeContract(
req: InvokeContractV1Request,
): Promise<InvokeContractV1Response> {
const fnTag = `${this.className}#invokeContract()`;
const contractName = req.contractName;
let contractInstance: InstanceType<typeof Contract>;
if (req.keychainId != undefined) {
const network... | maramih/cactus | packages/cactus-plugin-ledger-connector-quorum/src/main/typescript/plugin-ledger-connector-quorum.ts | TypeScript |
MethodDeclaration |
public async transact(
req: RunTransactionRequest,
): Promise<RunTransactionResponse> {
const fnTag = `${this.className}#transact()`;
switch (req.web3SigningCredential.type) {
case Web3SigningCredentialType.CactusKeychainRef: {
return this.transactCactusKeychainRef(req);
}
case... | maramih/cactus | packages/cactus-plugin-ledger-connector-quorum/src/main/typescript/plugin-ledger-connector-quorum.ts | TypeScript |
MethodDeclaration |
public async transactSigned(
rawTransaction: string,
): Promise<RunTransactionResponse> {
const fnTag = `${this.className}#transactSigned()`;
const receipt = await this.web3.eth.sendSignedTransaction(rawTransaction);
if (receipt instanceof Error) {
this.log.debug(`${fnTag} Web3 sendSignedTran... | maramih/cactus | packages/cactus-plugin-ledger-connector-quorum/src/main/typescript/plugin-ledger-connector-quorum.ts | TypeScript |
MethodDeclaration |
public async transactGethKeychain(
txIn: RunTransactionRequest,
): Promise<RunTransactionResponse> {
const fnTag = `${this.className}#transactGethKeychain()`;
const { sendTransaction } = this.web3.eth.personal;
const { transactionConfig, web3SigningCredential } = txIn;
const {
secret,
}... | maramih/cactus | packages/cactus-plugin-ledger-connector-quorum/src/main/typescript/plugin-ledger-connector-quorum.ts | TypeScript |
MethodDeclaration |
public async transactPrivateKey(
req: RunTransactionRequest,
): Promise<RunTransactionResponse> {
const fnTag = `${this.className}#transactPrivateKey()`;
const { transactionConfig, web3SigningCredential } = req;
const {
secret,
} = web3SigningCredential as Web3SigningCredentialPrivateKeyHex... | maramih/cactus | packages/cactus-plugin-ledger-connector-quorum/src/main/typescript/plugin-ledger-connector-quorum.ts | TypeScript |
MethodDeclaration |
public async transactCactusKeychainRef(
req: RunTransactionRequest,
): Promise<RunTransactionResponse> {
const fnTag = `${this.className}#transactCactusKeychainRef()`;
const { transactionConfig, web3SigningCredential } = req;
const {
ethAccount,
keychainEntryKey,
keychainId,
} =... | maramih/cactus | packages/cactus-plugin-ledger-connector-quorum/src/main/typescript/plugin-ledger-connector-quorum.ts | TypeScript |
MethodDeclaration |
public async pollForTxReceipt(
txHash: string,
timeoutMs = 60000,
): Promise<TransactionReceipt> {
const fnTag = `${this.className}#pollForTxReceipt()`;
let txReceipt;
let timedOut = false;
let tries = 0;
const startedAt = new Date();
do {
txReceipt = await this.web3.eth.getTra... | maramih/cactus | packages/cactus-plugin-ledger-connector-quorum/src/main/typescript/plugin-ledger-connector-quorum.ts | TypeScript |
MethodDeclaration |
public async deployContract(
req: DeployContractSolidityBytecodeV1Request,
): Promise<RunTransactionResponse> {
const fnTag = `${this.className}#deployContract()`;
Checks.truthy(req, `${fnTag} req`);
if (isWeb3SigningCredentialNone(req.web3SigningCredential)) {
throw new Error(`${fnTag} Cannot... | maramih/cactus | packages/cactus-plugin-ledger-connector-quorum/src/main/typescript/plugin-ledger-connector-quorum.ts | TypeScript |
ArrowFunction |
(state = initialState.ui, action) => {
switch (action.type) {
case TOGGLE_VIDEO_DIALOG:
return Object.assign({}, state, {
videoDialog: Object.assign({}, state.videoDialog, action.value),
});
case SET_VIEWPORT_SIZE:
return Object.assign({}, state, {
viewport: Object.assign({}... | kurnhyalcantara/hmiasadiyah | src/redux/reducer.ts | TypeScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.