type
stringclasses
7 values
content
stringlengths
4
9.55k
repo
stringlengths
7
96
path
stringlengths
4
178
language
stringclasses
1 value
TypeAliasDeclaration
export type MainStateActions = | SetAllDocuments | SetDocumentLoading | NextDocument | PreviousDocument | UpdateCurrentDocument | SetRendererRect | SetMainConfig | SetCurrentDocument;
buyerassist-io/react-doc-viewer
src/state/actions.ts
TypeScript
FunctionDeclaration
export function setComponentTemplate(template: TF, klass: any): any;
TheLooseCannon/ember-elements
packages/core/types/global.d.ts
TypeScript
TypeAliasDeclaration
type TF = TemplateFactory;
TheLooseCannon/ember-elements
packages/core/types/global.d.ts
TypeScript
FunctionDeclaration
export declare function parseVueRequest(id: string): { filename: string; query: VueQuery; };
278440912/vue30
node_modules/@vitejs/plugin-vue/dist/index.d.ts
TypeScript
FunctionDeclaration
declare function vuePlugin(rawOptions?: Options): Plugin_2;
278440912/vue30
node_modules/@vitejs/plugin-vue/dist/index.d.ts
TypeScript
InterfaceDeclaration
export declare interface Options { include?: string | RegExp | (string | RegExp)[]; exclude?: string | RegExp | (string | RegExp)[]; isProduction?: boolean; script?: Partial<SFCScriptCompileOptions>; template?: Partial<SFCTemplateCompileOptions>; style?: Partial<SFCStyleCompileOptions>; /** * @deprecated the plugin now auto-detects whether it's being invoked for ssr. */ ssr?: boolean; }
278440912/vue30
node_modules/@vitejs/plugin-vue/dist/index.d.ts
TypeScript
InterfaceDeclaration
export declare interface ResolvedOptions extends Options { root: string; devServer?: ViteDevServer; }
278440912/vue30
node_modules/@vitejs/plugin-vue/dist/index.d.ts
TypeScript
InterfaceDeclaration
export declare interface VueQuery { vue?: boolean; src?: boolean; type?: 'script' | 'template' | 'style' | 'custom'; index?: number; lang?: string; raw?: boolean; }
278440912/vue30
node_modules/@vitejs/plugin-vue/dist/index.d.ts
TypeScript
ClassDeclaration
@Injectable() export class CircleService { constructor( @InjectModel(Circle.name) private circleModel: Model<CircleDocument>, ) {} async create(createCircleDto: CreateCircleDto): Promise<Circle> { return new this.circleModel(createCircleDto).save(); } async findAll(): Promise<Circle[]> { return this.circleModel.find().exec(); } async findOne(id: ObjectId) { return this.circleModel.findById(id); } //async update(id: ObjectId, updateCircleDto: UpdateCircleDto) { //return this.circleModel.updateOne({ id }, { $set: updateCircleDto }); //} //async remove(id: ObjectId) { //return this.circleModel.deleteOne({ id }); //} }
saiboTBre/holobe
src/domain/circle/circle.service.ts
TypeScript
MethodDeclaration
async create(createCircleDto: CreateCircleDto): Promise<Circle> { return new this.circleModel(createCircleDto).save(); }
saiboTBre/holobe
src/domain/circle/circle.service.ts
TypeScript
MethodDeclaration
async findAll(): Promise<Circle[]> { return this.circleModel.find().exec(); }
saiboTBre/holobe
src/domain/circle/circle.service.ts
TypeScript
MethodDeclaration
async findOne(id: ObjectId) { return this.circleModel.findById(id); }
saiboTBre/holobe
src/domain/circle/circle.service.ts
TypeScript
ClassDeclaration
@Component({ selector: "jigsaw-header,j-header", templateUrl: "header.html", host: { "[class.jigsaw-header-host]": "true", "[class.jigsaw-header-level-1]": "level == 1", "[class.jigsaw-header-level-2]": "level == 2", "[class.jigsaw-header-level-3]": "level == 3" }, changeDetection: ChangeDetectionStrategy.OnPush }) export class JigsawHeader extends AbstractJigsawComponent { /** * @NoMarkForCheckRequired */ @Input() public level: 1 | 2 | 3 = 2; }
dingxiaoxue/jigsaw
src/jigsaw/pc-components/header/header.ts
TypeScript
ClassDeclaration
@NgModule({ imports: [CommonModule], declarations: [JigsawHeader], exports: [JigsawHeader] }) export class JigsawHeaderModule {}
dingxiaoxue/jigsaw
src/jigsaw/pc-components/header/header.ts
TypeScript
InterfaceDeclaration
interface IUbiquityGovernanceInterface extends ethers.utils.Interface { functions: { "allowance(address,address)": FunctionFragment; "approve(address,uint256)": FunctionFragment; "balanceOf(address)": FunctionFragment; "burn(uint256)": FunctionFragment; "burnFrom(address,uint256)": FunctionFragment; "mint(address,uint256)": FunctionFragment; "permit(address,address,uint256,uint256,uint8,bytes32,bytes32)": FunctionFragment; "totalSupply()": FunctionFragment; "transfer(address,uint256)": FunctionFragment; "transferFrom(address,address,uint256)": FunctionFragment; }; encodeFunctionData( functionFragment: "allowance", values: [string, string] ): string; encodeFunctionData( functionFragment: "approve", values: [string, BigNumberish] ): string; encodeFunctionData(functionFragment: "balanceOf", values: [string]): string; encodeFunctionData(functionFragment: "burn", values: [BigNumberish]): string; encodeFunctionData( functionFragment: "burnFrom", values: [string, BigNumberish] ): string; encodeFunctionData( functionFragment: "mint", values: [string, BigNumberish] ): string; encodeFunctionData( functionFragment: "permit", values: [ string, string, BigNumberish, BigNumberish, BigNumberish, BytesLike, BytesLike ] ): string; encodeFunctionData( functionFragment: "totalSupply", values?: undefined ): string; encodeFunctionData( functionFragment: "transfer", values: [string, BigNumberish] ): string; encodeFunctionData( functionFragment: "transferFrom", values: [string, string, BigNumberish] ): string; decodeFunctionResult(functionFragment: "allowance", data: BytesLike): Result; decodeFunctionResult(functionFragment: "approve", data: BytesLike): Result; decodeFunctionResult(functionFragment: "balanceOf", data: BytesLike): Result; decodeFunctionResult(functionFragment: "burn", data: BytesLike): Result; decodeFunctionResult(functionFragment: "burnFrom", data: BytesLike): Result; decodeFunctionResult(functionFragment: "mint", data: BytesLike): Result; decodeFunctionResult(functionFragment: "permit", data: BytesLike): Result; decodeFunctionResult( functionFragment: "totalSupply", data: BytesLike ): Result; decodeFunctionResult(functionFragment: "transfer", data: BytesLike): Result; decodeFunctionResult( functionFragment: "transferFrom", data: BytesLike ): Result; events: { "Approval(address,address,uint256)": EventFragment; "Burning(address,uint256)": EventFragment; "Minting(address,address,uint256)": EventFragment; "Transfer(address,address,uint256)": EventFragment; }; getEvent(nameOrSignatureOrTopic: "Approval"): EventFragment; getEvent(nameOrSignatureOrTopic: "Burning"): EventFragment; getEvent(nameOrSignatureOrTopic: "Minting"): EventFragment; getEvent(nameOrSignatureOrTopic: "Transfer"): EventFragment; }
Zequez/uad-ui-launch
frontend/src/types/IUbiquityGovernance.d.ts
TypeScript
MethodDeclaration
allowance( owner: string, spender: string, overrides?: CallOverrides ): Promise<BigNumber>;
Zequez/uad-ui-launch
frontend/src/types/IUbiquityGovernance.d.ts
TypeScript
MethodDeclaration
"allowance(address,address)"( owner: string, spender: string, overrides?: CallOverrides ): Promise<BigNumber>;
Zequez/uad-ui-launch
frontend/src/types/IUbiquityGovernance.d.ts
TypeScript
MethodDeclaration
approve( spender: string, amount: BigNumberish, overrides?: Overrides & { from?: string | Promise<string> } ): Promise<ContractTransaction>;
Zequez/uad-ui-launch
frontend/src/types/IUbiquityGovernance.d.ts
TypeScript
MethodDeclaration
"approve(address,uint256)"( spender: string, amount: BigNumberish, overrides?: Overrides & { from?: string | Promise<string> } ): Promise<ContractTransaction>;
Zequez/uad-ui-launch
frontend/src/types/IUbiquityGovernance.d.ts
TypeScript
MethodDeclaration
balanceOf(account: string, overrides?: CallOverrides): Promise<BigNumber>;
Zequez/uad-ui-launch
frontend/src/types/IUbiquityGovernance.d.ts
TypeScript
MethodDeclaration
"balanceOf(address)"( account: string, overrides?: CallOverrides ): Promise<BigNumber>;
Zequez/uad-ui-launch
frontend/src/types/IUbiquityGovernance.d.ts
TypeScript
MethodDeclaration
burn( amount: BigNumberish, overrides?: Overrides & { from?: string | Promise<string> } ): Promise<ContractTransaction>;
Zequez/uad-ui-launch
frontend/src/types/IUbiquityGovernance.d.ts
TypeScript
MethodDeclaration
"burn(uint256)"( amount: BigNumberish, overrides?: Overrides & { from?: string | Promise<string> } ): Promise<ContractTransaction>;
Zequez/uad-ui-launch
frontend/src/types/IUbiquityGovernance.d.ts
TypeScript
MethodDeclaration
burnFrom( account: string, amount: BigNumberish, overrides?: Overrides & { from?: string | Promise<string> } ): Promise<ContractTransaction>;
Zequez/uad-ui-launch
frontend/src/types/IUbiquityGovernance.d.ts
TypeScript
MethodDeclaration
"burnFrom(address,uint256)"( account: string, amount: BigNumberish, overrides?: Overrides & { from?: string | Promise<string> } ): Promise<ContractTransaction>;
Zequez/uad-ui-launch
frontend/src/types/IUbiquityGovernance.d.ts
TypeScript
MethodDeclaration
mint( account: string, amount: BigNumberish, overrides?: Overrides & { from?: string | Promise<string> } ): Promise<ContractTransaction>;
Zequez/uad-ui-launch
frontend/src/types/IUbiquityGovernance.d.ts
TypeScript
MethodDeclaration
"mint(address,uint256)"( account: string, amount: BigNumberish, overrides?: Overrides & { from?: string | Promise<string> } ): Promise<ContractTransaction>;
Zequez/uad-ui-launch
frontend/src/types/IUbiquityGovernance.d.ts
TypeScript
MethodDeclaration
permit( owner: string, spender: string, value: BigNumberish, deadline: BigNumberish, v: BigNumberish, r: BytesLike, s: BytesLike, overrides?: Overrides & { from?: string | Promise<string> } ): Promise<ContractTransaction>;
Zequez/uad-ui-launch
frontend/src/types/IUbiquityGovernance.d.ts
TypeScript
MethodDeclaration
"permit(address,address,uint256,uint256,uint8,bytes32,bytes32)"( owner: string, spender: string, value: BigNumberish, deadline: BigNumberish, v: BigNumberish, r: BytesLike, s: BytesLike, overrides?: Overrides & { from?: string | Promise<string> } ): Promise<ContractTransaction>;
Zequez/uad-ui-launch
frontend/src/types/IUbiquityGovernance.d.ts
TypeScript
MethodDeclaration
totalSupply(overrides?: CallOverrides): Promise<BigNumber>;
Zequez/uad-ui-launch
frontend/src/types/IUbiquityGovernance.d.ts
TypeScript
MethodDeclaration
"totalSupply()"(overrides?: CallOverrides): Promise<BigNumber>;
Zequez/uad-ui-launch
frontend/src/types/IUbiquityGovernance.d.ts
TypeScript
MethodDeclaration
transfer( recipient: string, amount: BigNumberish, overrides?: Overrides & { from?: string | Promise<string> } ): Promise<ContractTransaction>;
Zequez/uad-ui-launch
frontend/src/types/IUbiquityGovernance.d.ts
TypeScript
MethodDeclaration
"transfer(address,uint256)"( recipient: string, amount: BigNumberish, overrides?: Overrides & { from?: string | Promise<string> } ): Promise<ContractTransaction>;
Zequez/uad-ui-launch
frontend/src/types/IUbiquityGovernance.d.ts
TypeScript
MethodDeclaration
transferFrom( sender: string, recipient: string, amount: BigNumberish, overrides?: Overrides & { from?: string | Promise<string> } ): Promise<ContractTransaction>;
Zequez/uad-ui-launch
frontend/src/types/IUbiquityGovernance.d.ts
TypeScript
MethodDeclaration
"transferFrom(address,address,uint256)"( sender: string, recipient: string, amount: BigNumberish, overrides?: Overrides & { from?: string | Promise<string> } ): Promise<ContractTransaction>;
Zequez/uad-ui-launch
frontend/src/types/IUbiquityGovernance.d.ts
TypeScript
FunctionDeclaration
function Bomb() { // console.log(""); // throw new Error("Boom"); }
NeoSOFT-Technologies/console
src/pages/features/gateway/api/list/APIList.tsx
TypeScript
FunctionDeclaration
export default function APIList() { const handleError = useErrorHandler(); try { Bomb(); } catch (error) { handleError(error); } const navigate = useNavigate(); const [selected, setSelected] = useState(1); const [search, setSearch] = useState(" "); const [DeleteApiId, SetDeleteApiId] = useState<string>(); const [show, setShow] = useState(false); const dispatch = useAppDispatch(); const apiList: IApiListState = useAppSelector( (state: RootState) => state.apiListState ); // handleError(apiList.error); const failure: any = () => ToastAlert(apiList.error!, "error"); const [datalist, setDataList] = useState<IApiDataList>({ list: [], fields: [], }); const mainCall = async (currentPage: number, pageSize: number) => { dispatch(getApiList({ currentPage, pageSize })); // handleError(resp.payload); }; useEffect(() => { if (apiList.data && apiList.data?.Apis?.length > 0) { const listAPI: IApiData[] = []; for (const item of apiList.data?.Apis) { const api = statusAndDateHelper(item); listAPI.push(api); } setDataList({ list: [...listAPI], fields: ["Name", "TargetUrl", "Status", "CreatedDateTxt"], }); } }, [apiList.data]); useEffect(() => { mainCall(1, 4); }, []); const handlePageClick = (pageSelected: number) => { mainCall(pageSelected, 4); setSelected(pageSelected); }; const searchFilter = (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => { e.preventDefault(); const newSearchList = datalist.list.filter((item) => item.Name.toLocaleLowerCase().includes(search) ); setDataList({ list: [...newSearchList], fields: ["Name", "TargetUrl", "Status", "CreatedDateTxt"], }); }; const NavigateCreateApi = ( val: React.MouseEvent<HTMLButtonElement, MouseEvent> ) => { val.preventDefault(); navigate("/gateway/apis/create"); }; const NavigateUpdate = (val: IApiData) => { if (val.Id) { navigate(`/gateway/apis/update/${val.Id}`); } }; function deleteApiFromState(id: string) { const newState = datalist.list.filter((item) => item.Id !== id); // console.log(newState); const pageCount = apiList.data?.TotalCount; if (newState.length === 0 && pageCount !== 1) { mainCall(selected - 1, 4); setSelected(selected - 1); } else mainCall(selected, 4); setDataList({ list: [...newState], fields: ["Name", "TargetUrl", "Status", "CreatedDateTxt"], }); } const handleDelete = async (Id: string) => { setShow(false); // console.log("delete clicked", Id); const result = await dispatch(deleteApi(Id)); if (result.meta.requestStatus === "rejected") { await ToastAlert(result.payload.message, "error"); } else { deleteApiFromState(Id); await ToastAlert("Api Deleted Successfully", "success"); } }; const handleCancel = () => setShow(false); const deleteApiFunction = async (val: IApiData) => { if (val.Id && val.Id) { setShow(true); SetDeleteApiId(val.Id); } }; const headings = [ { title: "Name" }, { title: "Target Url" }, { title: "Status" }, { title: "Created Date" }, ]; const actions = []; const delAction = { className: "btn btn-sm btn-light", iconClassName: "bi bi-trash-fill menu-icon", buttonFunction: deleteApiFunction, }; const editAction = { className: "btn btn-sm btn-light", iconClassName: "bi bi-pencil-square menu-icon", buttonFunction: NavigateUpdate, }; const isViewAuthorized = AuthGuard({ resource: access.resources.Api, scope: access.scopes.View, }); if (isViewAuthorized) { actions.push(editAction); } const isDelAuthorized = AuthGuard({ resource: access.resources.Api, scope: access.scopes.Delete, }); if (isDelAuthorized) { actions.push(delAction); } if (isViewAuthorized || isDelAuthorized) { headings.push({ title: "Action" }); } useEffect(() => { // console.log(apiList); }, [apiList.data, apiList.error]); return ( <> <Modal show={show} onHide={handleCancel} centered> <Modal.Header closeButton> <Modal.Title>Delete Api</Modal.Title> </Modal.Header> <Modal.Body>Are you sure you want to delete this Api ?</Modal.Body> <Modal.Footer> <Button variant="secondary" onClick={handleCancel}> Cancel </Button> <Button variant="primary" className="btn-danger" onClick={() => handleDelete(DeleteApiId!)}
NeoSOFT-Technologies/console
src/pages/features/gateway/api/list/APIList.tsx
TypeScript
FunctionDeclaration
function deleteApiFromState(id: string) { const newState = datalist.list.filter((item) => item.Id !== id); // console.log(newState); const pageCount = apiList.data?.TotalCount; if (newState.length === 0 && pageCount !== 1) { mainCall(selected - 1, 4); setSelected(selected - 1); } else mainCall(selected, 4); setDataList({ list: [...newState], fields: ["Name", "TargetUrl", "Status", "CreatedDateTxt"], }); }
NeoSOFT-Technologies/console
src/pages/features/gateway/api/list/APIList.tsx
TypeScript
ArrowFunction
(state: RootState) => state.apiListState
NeoSOFT-Technologies/console
src/pages/features/gateway/api/list/APIList.tsx
TypeScript
ArrowFunction
() => ToastAlert(apiList.error!, "error")
NeoSOFT-Technologies/console
src/pages/features/gateway/api/list/APIList.tsx
TypeScript
ArrowFunction
async (currentPage: number, pageSize: number) => { dispatch(getApiList({ currentPage, pageSize })); // handleError(resp.payload); }
NeoSOFT-Technologies/console
src/pages/features/gateway/api/list/APIList.tsx
TypeScript
ArrowFunction
() => { if (apiList.data && apiList.data?.Apis?.length > 0) { const listAPI: IApiData[] = []; for (const item of apiList.data?.Apis) { const api = statusAndDateHelper(item); listAPI.push(api); } setDataList({ list: [...listAPI], fields: ["Name", "TargetUrl", "Status", "CreatedDateTxt"], }); } }
NeoSOFT-Technologies/console
src/pages/features/gateway/api/list/APIList.tsx
TypeScript
ArrowFunction
() => { mainCall(1, 4); }
NeoSOFT-Technologies/console
src/pages/features/gateway/api/list/APIList.tsx
TypeScript
ArrowFunction
(pageSelected: number) => { mainCall(pageSelected, 4); setSelected(pageSelected); }
NeoSOFT-Technologies/console
src/pages/features/gateway/api/list/APIList.tsx
TypeScript
ArrowFunction
(e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => { e.preventDefault(); const newSearchList = datalist.list.filter((item) => item.Name.toLocaleLowerCase().includes(search) ); setDataList({ list: [...newSearchList], fields: ["Name", "TargetUrl", "Status", "CreatedDateTxt"], }); }
NeoSOFT-Technologies/console
src/pages/features/gateway/api/list/APIList.tsx
TypeScript
ArrowFunction
(item) => item.Name.toLocaleLowerCase().includes(search)
NeoSOFT-Technologies/console
src/pages/features/gateway/api/list/APIList.tsx
TypeScript
ArrowFunction
( val: React.MouseEvent<HTMLButtonElement, MouseEvent> ) => { val.preventDefault(); navigate("/gateway/apis/create"); }
NeoSOFT-Technologies/console
src/pages/features/gateway/api/list/APIList.tsx
TypeScript
ArrowFunction
(val: IApiData) => { if (val.Id) { navigate(`/gateway/apis/update/${val.Id}`); } }
NeoSOFT-Technologies/console
src/pages/features/gateway/api/list/APIList.tsx
TypeScript
ArrowFunction
(item) => item.Id !== id
NeoSOFT-Technologies/console
src/pages/features/gateway/api/list/APIList.tsx
TypeScript
ArrowFunction
async (Id: string) => { setShow(false); // console.log("delete clicked", Id); const result = await dispatch(deleteApi(Id)); if (result.meta.requestStatus === "rejected") { await ToastAlert(result.payload.message, "error"); } else { deleteApiFromState(Id); await ToastAlert("Api Deleted Successfully", "success"); } }
NeoSOFT-Technologies/console
src/pages/features/gateway/api/list/APIList.tsx
TypeScript
ArrowFunction
() => setShow(false)
NeoSOFT-Technologies/console
src/pages/features/gateway/api/list/APIList.tsx
TypeScript
ArrowFunction
async (val: IApiData) => { if (val.Id && val.Id) { setShow(true); SetDeleteApiId(val.Id); } }
NeoSOFT-Technologies/console
src/pages/features/gateway/api/list/APIList.tsx
TypeScript
ArrowFunction
() => { // console.log(apiList); }
NeoSOFT-Technologies/console
src/pages/features/gateway/api/list/APIList.tsx
TypeScript
MethodDeclaration
failure()
NeoSOFT-Technologies/console
src/pages/features/gateway/api/list/APIList.tsx
TypeScript
ArrowFunction
( props: FileUploadComponent.IProps ): React.ReactElement<FileUploadComponent.IProps> => { return ( <GroupItem spacing={vars.textIconHalfSpacing}> <TextItem source={'Uploading'} /> <ProgressBar percentage={props.upload} /> </GroupItem>
takashimokobe/jupyterlab-statusbar
src/defaults/fileUpload.tsx
TypeScript
ArrowFunction
( tracker: InstanceTracker<FileBrowser>, browser: FileBrowser | null ) => { if (browser === null) { this.model!.browserModel = null; } else { this.model!.browserModel = browser.model; } }
takashimokobe/jupyterlab-statusbar
src/defaults/fileUpload.tsx
TypeScript
ArrowFunction
( browse: FileBrowserModel, uploads: IChangedArgs<IUploadModel> ) => { if (uploads.name === 'start') { this._items.push({ path: uploads.newValue.path, progress: uploads.newValue.progress * 100, complete: false }); } else if (uploads.name === 'update') { const idx = ArrayExt.findFirstIndex( this._items, val => val.path === uploads.oldValue.path ); this._items[idx].progress = uploads.newValue.progress * 100; } else if (uploads.name === 'finish') { const idx = ArrayExt.findFirstIndex( this._items, val => val.path === uploads.oldValue.path ); this._items[idx].complete = true; setTimeout(() => { ArrayExt.removeAt(this._items, idx); this.stateChanged.emit(void 0); }, UPLOAD_COMPLETE_MESSAGE_MILLIS); } this.stateChanged.emit(void 0); }
takashimokobe/jupyterlab-statusbar
src/defaults/fileUpload.tsx
TypeScript
ArrowFunction
val => val.path === uploads.oldValue.path
takashimokobe/jupyterlab-statusbar
src/defaults/fileUpload.tsx
TypeScript
ArrowFunction
() => { ArrayExt.removeAt(this._items, idx); this.stateChanged.emit(void 0); }
takashimokobe/jupyterlab-statusbar
src/defaults/fileUpload.tsx
TypeScript
ArrowFunction
( app: JupyterLab, manager: IDefaultsManager, browser: IFileBrowserFactory ) => { const item = new FileUpload({ tracker: browser.tracker }); manager.addDefaultStatus('file-upload-item', item, { align: 'middle', isActive: () => { return !!item.model && item.model.items.length > 0; }, stateChanged: item.model!.stateChanged }); return item; }
takashimokobe/jupyterlab-statusbar
src/defaults/fileUpload.tsx
TypeScript
ArrowFunction
() => { return !!item.model && item.model.items.length > 0; }
takashimokobe/jupyterlab-statusbar
src/defaults/fileUpload.tsx
TypeScript
ClassDeclaration
class FileUpload extends VDomRenderer<FileUpload.Model> implements IFileUpload { constructor(opts: FileUpload.IOptions) { super(); this._tracker = opts.tracker; this._tracker.currentChanged.connect(this._onBrowserChange); this.model = new FileUpload.Model( this._tracker.currentWidget && this._tracker.currentWidget.model ); } render() { const uploadPaths = this.model!.items; if (uploadPaths.length > 0) { const item = this.model!.items[0]; if (item.complete) { return <TextItem source="Complete!" />; } else { return ( <FileUploadComponent upload={this.model!.items[0].progress} /> ); } } else { return <FileUploadComponent upload={100} />; } } dispose() { super.dispose(); this._tracker.currentChanged.disconnect(this._onBrowserChange); } private _onBrowserChange = ( tracker: InstanceTracker<FileBrowser>, browser: FileBrowser | null ) => { if (browser === null) { this.model!.browserModel = null; } else { this.model!.browserModel = browser.model; } }; private _tracker: InstanceTracker<FileBrowser>; }
takashimokobe/jupyterlab-statusbar
src/defaults/fileUpload.tsx
TypeScript
ClassDeclaration
export class Model extends VDomModel implements IFileUpload.IModel { constructor(browserModel: FileBrowserModel | null) { super(); this.browserModel = browserModel; } get items() { return this._items; } get browserModel() { return this._browserModel; } set browserModel(browserModel: FileBrowserModel | null) { const oldBrowserModel = this._browserModel; if (oldBrowserModel) { oldBrowserModel.uploadChanged.disconnect(this._uploadChanged); } this._browserModel = browserModel; this._items = []; if (this._browserModel !== null) { this._browserModel.uploadChanged.connect(this._uploadChanged); } this.stateChanged.emit(void 0); } private _uploadChanged = ( browse: FileBrowserModel, uploads: IChangedArgs<IUploadModel> ) => { if (uploads.name === 'start') { this._items.push({ path: uploads.newValue.path, progress: uploads.newValue.progress * 100, complete: false }); } else if (uploads.name === 'update') { const idx = ArrayExt.findFirstIndex( this._items, val => val.path === uploads.oldValue.path ); this._items[idx].progress = uploads.newValue.progress * 100; } else if (uploads.name === 'finish') { const idx = ArrayExt.findFirstIndex( this._items, val => val.path === uploads.oldValue.path ); this._items[idx].complete = true; setTimeout(() => { ArrayExt.removeAt(this._items, idx); this.stateChanged.emit(void 0); }, UPLOAD_COMPLETE_MESSAGE_MILLIS); } this.stateChanged.emit(void 0); }; private _items: Array<IFileUpload.IItem> = []; private _browserModel: FileBrowserModel | null = null; }
takashimokobe/jupyterlab-statusbar
src/defaults/fileUpload.tsx
TypeScript
InterfaceDeclaration
export interface IProps { upload: number; }
takashimokobe/jupyterlab-statusbar
src/defaults/fileUpload.tsx
TypeScript
InterfaceDeclaration
export interface IOptions { readonly tracker: InstanceTracker<FileBrowser>; }
takashimokobe/jupyterlab-statusbar
src/defaults/fileUpload.tsx
TypeScript
InterfaceDeclaration
export interface IFileUpload extends IDisposable { readonly model: IFileUpload.IModel | null; readonly modelChanged: ISignal<this, void>; }
takashimokobe/jupyterlab-statusbar
src/defaults/fileUpload.tsx
TypeScript
InterfaceDeclaration
export interface IModel { readonly items: Array<IFileUpload.IItem>; readonly browserModel: FileBrowserModel | null; }
takashimokobe/jupyterlab-statusbar
src/defaults/fileUpload.tsx
TypeScript
InterfaceDeclaration
export interface IItem { path: string; progress: number; complete: boolean; }
takashimokobe/jupyterlab-statusbar
src/defaults/fileUpload.tsx
TypeScript
MethodDeclaration
render() { const uploadPaths = this.model!.items; if (uploadPaths.length > 0) { const item = this.model!.items[0]; if (item.complete) { return <TextItem source="Complete!" />; } else { return ( <FileUploadComponent upload={this.model!.items[0].progress} /> ); } } else { return <FileUploadComponent upload={100} />; } }
takashimokobe/jupyterlab-statusbar
src/defaults/fileUpload.tsx
TypeScript
MethodDeclaration
dispose() { super.dispose(); this._tracker.currentChanged.disconnect(this._onBrowserChange); }
takashimokobe/jupyterlab-statusbar
src/defaults/fileUpload.tsx
TypeScript
ClassDeclaration
class Logo extends React.Component<ILogoProps> { render(): React.ReactElement<any, string | React.JSXElementConstructor<any>> { return ( <svg className={this.props.className} width={this.props.width} height={this.props.height} cursor="default" viewBox="0 0 132.29166 100.54166" xmlns="http://www.w3.org/2000/svg"> <g transform="translate(-62.682 -89.137)"> <g transform="matrix(.35278 0 0 -.35278 -35.278 289.94)"> <g transform="translate(81.396 5.6785)" clipPath="url(#clipPath3773)"> <g transform="translate(382.64 432.97)"> <path d="m0 0v50.268c0 37.404-26.925 67.725-60.137 67.725-33.214 0-60.138-30.321-60.138-67.725v-50.268c0.47-18.33 1.474-27.488 2.535-35.734 2.655-31.097 21.752-48.421 48.98-52.837 2.714-0.608 4.363-0.774 4.363-0.774h189.08c-130.62 56.525-124.68 89.345-124.68 89.345" fill="#666"/> </g> <g transform="translate(339.26 492)"> <path d="m0 0c0 9.259-7.505 16.762-16.76 16.762-9.257 0-16.763-7.503-16.763-16.762 0-9.256 7.506-16.761 16.763-16.761 9.255 0 16.76 7.505 16.76 16.761" fill="#ccc"/> </g> <g transform="translate(298.84 505.97)"> <path d="m0 0c5.257 0 5.257 8.15 0 8.15-5.258 0-5.258-8.15 0-8.15" fill="#ccc"/> </g> <g transform="translate(322.5 492.58)"> <path d="m0 0c6.58 0 6.58 8.154 0 8.154-6.579 0-6.579-8.154 0-8.154" fill="#333"/> </g> <g transform="translate(349.56 505.97)"> <path d="m0 0c5.258 0 5.258 8.15 0 8.15-5.257 0-5.257-8.15 0-8.15" fill="#ccc"/> </g> <g transform="translate(322.5 492.58)"> <path d="m0 0s-1.452-6.64-8.525-6.679" fill="none" stroke="#666" strokeMiterlimit="10"/> </g> <g transform="translate(322.01 492.58)"> <path d="m0 0s1.452-6.64 8.524-6.679" fill="none" stroke="#666" strokeMiterlimit="10"/> </g> <g transform="translate(256.72 509.69)"> <path d="m0 0c9.337 0 19.203-4.404 27.132-8.456" fill="none" stroke="#333" strokeMiterlimit="10"/> </g> <g transform="translate(255.31 501.05)"> <path d="m0 0c8.811 0 16.913-3.701 25.546-4.582" fill="none" stroke="#333" strokeMiterlimit="10"/> </g> <g transform="translate(254.08 490.48)"> <path d="m0 0c6.343 0 12.684 1.233 19.203 1.057 2.468 0 4.757-0.353 7.225-0.353" fill="none" stroke="#333" strokeMiterlimit="10"/> </g> <g transform="translate(390.26 509.69)"> <path d="m0 0c-9.337 0-19.203-4.404-27.132-8.456" fill="none" stroke="#333" strokeMiterlimit="10"/> </g> <g transform="translate(391.68 501.05)"> <path d="m0 0c-8.812 0-16.912-3.701-25.546-4.582" fill="none" stroke="#333" strokeMiterlimit="10"/> </g> <g transform="translate(392.91 490.48)"> <path d="m0 0c-6.344 0-12.684 1.233-19.203 1.057-2.468 0-4.757-0.353-7.226-0.353" fill="none" stroke="#333" strokeMiterlimit="10"/> </g> <g transform="translate(481.84 350.69)"> <path d="m0 0s53.652 3.267 67.065-16.463c0 0-4.732-14.192-33.532-7.095 0 0 7.493-21.214 0-31.468l-33.533 55.026m177.95-108.9" fill="#555"/> </g> <g transform="translate(268.7 392.57)"> <path d="m0 0s-32.049-46.618-54.194-48.949c0 0 62.659-11.656 69.346 27.388" fill="#555"/> </g> <g transform="translate(382.3 392.57)"> <path d="m0 0s32.049-46.618 54.194-48.949c0 0-62.657-11.656-69.346 27.388" fill="#555"/> </g> </g> </g> </g> </svg> ); } }
hgpestana/foca
assets/tsx/components/Logo.tsx
TypeScript
InterfaceDeclaration
export interface ILogoProps { className?: string width: string height: string }
hgpestana/foca
assets/tsx/components/Logo.tsx
TypeScript
MethodDeclaration
render(): React.ReactElement<any, string | React.JSXElementConstructor<any>> { return ( <svg className={this.props.className} width={this.props.width} height={this.props.height} cursor="default" viewBox="0 0 132.29166 100.54166" xmlns="http://www.w3.org/2000/svg"> <g transform="translate(-62.682 -89.137)"> <g transform="matrix(.35278 0 0 -.35278 -35.278 289.94)"> <g transform="translate(81.396 5.6785)" clipPath="url(#clipPath3773)"> <g transform="translate(382.64 432.97)"> <path d="m0 0v50.268c0 37.404-26.925 67.725-60.137 67.725-33.214 0-60.138-30.321-60.138-67.725v-50.268c0.47-18.33 1.474-27.488 2.535-35.734 2.655-31.097 21.752-48.421 48.98-52.837 2.714-0.608 4.363-0.774 4.363-0.774h189.08c-130.62 56.525-124.68 89.345-124.68 89.345" fill="#666"/> </g> <g transform="translate(339.26 492)"> <path d="m0 0c0 9.259-7.505 16.762-16.76 16.762-9.257 0-16.763-7.503-16.763-16.762 0-9.256 7.506-16.761 16.763-16.761 9.255 0 16.76 7.505 16.76 16.761" fill="#ccc"/> </g> <g transform="translate(298.84 505.97)"> <path d="m0 0c5.257 0 5.257 8.15 0 8.15-5.258 0-5.258-8.15 0-8.15" fill="#ccc"/> </g> <g transform="translate(322.5 492.58)"> <path d="m0 0c6.58 0 6.58 8.154 0 8.154-6.579 0-6.579-8.154 0-8.154" fill="#333"/> </g> <g transform="translate(349.56 505.97)"> <path d="m0 0c5.258 0 5.258 8.15 0 8.15-5.257 0-5.257-8.15 0-8.15" fill="#ccc"/> </g> <g transform="translate(322.5 492.58)"> <path d="m0 0s-1.452-6.64-8.525-6.679" fill="none" stroke="#666" strokeMiterlimit="10"/> </g> <g transform="translate(322.01 492.58)"> <path d="m0 0s1.452-6.64 8.524-6.679" fill="none" stroke="#666" strokeMiterlimit="10"/> </g> <g transform="translate(256.72 509.69)"> <path d="m0 0c9.337 0 19.203-4.404 27.132-8.456" fill="none" stroke="#333" strokeMiterlimit="10"/> </g> <g transform="translate(255.31 501.05)"> <path d="m0 0c8.811 0 16.913-3.701 25.546-4.582" fill="none" stroke="#333" strokeMiterlimit="10"/> </g> <g transform="translate(254.08 490.48)"> <path d="m0 0c6.343 0 12.684 1.233 19.203 1.057 2.468 0 4.757-0.353 7.225-0.353" fill="none" stroke="#333" strokeMiterlimit="10"/> </g> <g transform="translate(390.26 509.69)"> <path d="m0 0c-9.337 0-19.203-4.404-27.132-8.456" fill="none" stroke="#333" strokeMiterlimit="10"/> </g> <g transform="translate(391.68 501.05)"> <path d="m0 0c-8.812 0-16.912-3.701-25.546-4.582" fill="none" stroke="#333" strokeMiterlimit="10"/> </g> <g transform="translate(392.91 490.48)"> <path d="m0 0c-6.344 0-12.684 1.233-19.203 1.057-2.468 0-4.757-0.353-7.226-0.353" fill="none" stroke="#333" strokeMiterlimit="10"/> </g> <g transform="translate(481.84 350.69)"> <path d="m0 0s53.652 3.267 67.065-16.463c0 0-4.732-14.192-33.532-7.095 0 0 7.493-21.214 0-31.468l-33.533 55.026m177.95-108.9" fill="#555"/> </g> <g transform="translate(268.7 392.57)"> <path d="m0 0s-32.049-46.618-54.194-48.949c0 0 62.659-11.656 69.346 27.388" fill="#555"/> </g> <g transform="translate(382.3 392.57)"> <path d="m0 0s32.049-46.618 54.194-48.949c0 0-62.657-11.656-69.346 27.388" fill="#555"/> </g> </g> </g> </g> </svg> ); }
hgpestana/foca
assets/tsx/components/Logo.tsx
TypeScript
InterfaceDeclaration
export interface ProfileService extends SdkServiceOnInitDelegate { createProfile(profile: Profile, profileSource: ProfileSource): Observable<Profile>; deleteProfile(uid: string): Observable<undefined>; updateProfile(profile: Profile): Observable<Profile>; updateServerProfile(updateServerProfileRequest: UpdateServerProfileInfoRequest): Observable<Profile>; getTenantInfo(): Observable<TenantInfo>; getServerProfiles(searchCriteria: ServerProfileSearchCriteria): Observable<ServerProfile[]>; getAllProfiles(profileRequest?: GetAllProfileRequest): Observable<Profile[]>; getServerProfilesDetails(serverProfileDetailsRequest: ServerProfileDetailsRequest): Observable<ServerProfile>; getActiveSessionProfile(): Observable<Profile>; setActiveSessionForProfile(profileUid: string): Observable<boolean>; getActiveProfileSession(): Observable<ProfileSession>; getAllContentAccess(criteria: ContentAccessFilterCriteria): Observable<ContentAccess[]>; addContentAccess(contentAccess: ContentAccess): Observable<boolean>; acceptTermsAndConditions(acceptTermsConditions: AcceptTermsConditionRequest): Observable<boolean>; isProfileAlreadyInUse(isProfileAlreadyInUseRequest: IsProfileAlreadyInUseRequest): Observable<ProfileExistsResponse>; generateOTP(generateOtpRequest: GenerateOtpRequest): Observable<boolean>; verifyOTP(verifyOTPRequest: VerifyOtpRequest): Observable<boolean>; searchLocation(locationSearchCriteria: LocationSearchCriteria): Observable<LocationSearchResult[]>; exportProfile(profileExportRequest: ProfileExportRequest): Observable<ProfileExportResponse>; importProfile(profileImportRequest: ProfileImportRequest): Observable<ProfileImportResponse>; }
Ajoymaity/sunbird-mobile-sdk
dist/profile/def/profile-service.d.ts
TypeScript
InterfaceDeclaration
interface Configs { pocer: { port: number; }; db: ClientConfig; eth: { baseURI: string; salt: string; node: string; networkId: number | string; account?: string | null; password?: string | null; }; }
funmaker/webapp-boilerplate
server/helpers/configs.ts
TypeScript
ArrowFunction
data => { this.array_eq = data ; aux = this.createRowData(this.array_eq) ; if ( aux.length > 0 ) { // Se rellena el combo... this.eq.push({label:'Seleccione equipo', value:null}); for (let i = 0; i < aux.length; i++) { ident = aux[i]['id'] ; label = "(" + aux[i]['codigo'] +") " + aux[i]['descripcion'] ; codigo = aux[i]['codigo'] ; desc = aux[i]['descripcion'] ; this.eq.push({label:label, value:{id:ident, name: desc, code: codigo}}); } } }
angeloide78/wShifts
cliente/app/categoria_equipo/categoria_equipo.component.ts
TypeScript
ArrowFunction
error => { this.errorMessage = <any>error ; this.mensajes('error_guardar', 'Error de acceso a servidores') ;}
angeloide78/wShifts
cliente/app/categoria_equipo/categoria_equipo.component.ts
TypeScript
ArrowFunction
data => { this.array_cp = data ; aux = this.createRowData(this.array_cp) ; if ( aux.length > 0 ) { // Se rellena el combo... this.cp.push({label:'Seleccione categoría', value:null}); for (let i = 0; i < aux.length; i++) { ident = aux[i]['id'] ; label = "(" + aux[i]['codigo'] +") " + aux[i]['descripcion'] ; codigo = aux[i]['codigo'] ; desc = aux[i]['descripcion'] ; this.cp.push({label:label, value:{id:ident, name: desc, code: codigo}}); } } }
angeloide78/wShifts
cliente/app/categoria_equipo/categoria_equipo.component.ts
TypeScript
MethodDeclaration
public cargarEquipo() { this.eq = []; // Variable para recoger lo que viene del backend. let aux: any[] ; // Variables. let desc: string ; let ident:number ; let codigo: string ; let label: string ; // Se llama a servicio de componente para recuperar información. this.equipoService.send_data({id: null, codigo: null, activo:'S', sf_id : null, asig_pend: 'N'},'recuperar') .subscribe ( data => { this.array_eq = data ; aux = this.createRowData(this.array_eq) ; if ( aux.length > 0 ) { // Se rellena el combo... this.eq.push({label:'Seleccione equipo', value:null}); for (let i = 0; i < aux.length; i++) { ident = aux[i]['id'] ; label = "(" + aux[i]['codigo'] +") " + aux[i]['descripcion'] ; codigo = aux[i]['codigo'] ; desc = aux[i]['descripcion'] ; this.eq.push({label:label, value:{id:ident, name: desc, code: codigo}}); } } }, error => { this.errorMessage = <any>error ; this.mensajes('error_guardar', 'Error de acceso a servidores') ;}) }
angeloide78/wShifts
cliente/app/categoria_equipo/categoria_equipo.component.ts
TypeScript
MethodDeclaration
public cargarCP() { this.cp = []; // Variable para recoger lo que viene del backend. let aux: any[] ; // Variables. let desc: string ; let ident:number ; let codigo: string ; let label: string ; // Se llama a servicio de componente para recuperar información. this.categoriaProfesionalServive.send_data({id_: null, activo:'S'},'recuperar') .subscribe ( data => { this.array_cp = data ; aux = this.createRowData(this.array_cp) ; if ( aux.length > 0 ) { // Se rellena el combo... this.cp.push({label:'Seleccione categoría', value:null}); for (let i = 0; i < aux.length; i++) { ident = aux[i]['id'] ; label = "(" + aux[i]['codigo'] +") " + aux[i]['descripcion'] ; codigo = aux[i]['codigo'] ; desc = aux[i]['descripcion'] ; this.cp.push({label:label, value:{id:ident, name: desc, code: codigo}}); } } }, error => { this.errorMessage = <any>error ; this.mensajes('error_guardar', 'Error de acceso a servidores') ;}) }
angeloide78/wShifts
cliente/app/categoria_equipo/categoria_equipo.component.ts
TypeScript
MethodDeclaration
public showDialog() { this.display = true; }
angeloide78/wShifts
cliente/app/categoria_equipo/categoria_equipo.component.ts
TypeScript
MethodDeclaration
insertarFila() { if ( this.eq_sel == null || this.cp_sel == null) { this.mensajes('error_guardar_filas') ; } else { let nuevoElemento = this.crearNuevaFilaDatos(); this.gridOptions.api.addItems([nuevoElemento]); } }
angeloide78/wShifts
cliente/app/categoria_equipo/categoria_equipo.component.ts
TypeScript
MethodDeclaration
public mensajes2(opcion: string): any { // Método para incluir nuevos mensajes. let ret = false ; let severity: string ; let summary:string ; let mensaje: string ; if (opcion == "error_guardar_filas") { ret = true ; severity = 'error' ; summary = 'wShifts informa:' ; mensaje = 'Es obligatorio insertar equipo y categoría' ; } return [ret, severity, summary, mensaje] ; }
angeloide78/wShifts
cliente/app/categoria_equipo/categoria_equipo.component.ts
TypeScript
MethodDeclaration
public validaciones(modelo: any): any { // Bandera de estado. let ret = true ; // Bolsa de filas nuevas. let bolsa: any [] = [] ; // Se itera por los nodos del modelo, para verificar que los datos son // correctos. Además se seleccionan las filas nuevas para ser devueltas // al backend. modelo.forEachNode(function(nodo_fila) { // Se chequean que haya datos para celdas específicas. if ((nodo_fila.data.eq_id.length == 0) || (nodo_fila.data.cat_id.length == 0)) { ret = false ; } // Si no cumple la validación, nos vamos. if ( !ret ) { return [ret, bolsa]} ; // ALGG 14-01-2017 Se recuperan las filas nuevas. if ( nodo_fila.data.id == 0 ) { // Se incluye fila en la bolsa. bolsa.push({ id : nodo_fila.data.id, eq_id : nodo_fila.data.eq_id, eq_cod : nodo_fila.data.eq_cod, eq_desc : nodo_fila.data.eq_desc, cat_id : nodo_fila.data.cat_id, cat_cod : nodo_fila.data.cat_cod, cat_desc : nodo_fila.data.cat_desc}) ; // Depuración. console.log(bolsa) ; } }) // Se devuelve la tupla [estado, datos]. return [ret, bolsa] ; }
angeloide78/wShifts
cliente/app/categoria_equipo/categoria_equipo.component.ts
TypeScript
MethodDeclaration
public crearNuevaFilaDatos() { let eq_id = this.eq_sel['id'] ; let eq_cod = this.eq_sel['code'] ; let eq_desc = this.eq_sel['name'] ; let cp_id = this.cp_sel['id'] ; let cp_cod = this.cp_sel['code'] ; let cp_desc = this.cp_sel['name'] ; let nuevaFila = { id : 0, eq_id : eq_id, eq_cod : eq_cod, eq_desc : eq_desc, cat_id : cp_id, cat_cod : cp_cod, cat_desc : cp_desc } // Se devuelven datos iniciales. return nuevaFila ; }
angeloide78/wShifts
cliente/app/categoria_equipo/categoria_equipo.component.ts
TypeScript
MethodDeclaration
public createColumnDefs() { return [ { headerName: "id", field: "id", hide: true, width: 100 }, { headerName: "eq_id", field: "eq_id", hide: true, width: 100 }, { headerName: "Código Equipo", field: "eq_cod", width: 130 }, { headerName: "Descripción Equipo", field: "eq_desc", width: 300 }, { headerName: "cat_id", field: "cat_id", hide: true, width: 100 }, { headerName: "Cód. Categ.", field: "cat_cod", width: 130 }, { headerName: "Descripción Categoría", field: "cat_desc", width: 300 } ]; }
angeloide78/wShifts
cliente/app/categoria_equipo/categoria_equipo.component.ts
TypeScript
ArrowFunction
() => { const stack = new Stack(); const pattern = new ApiGatewayToSageMakerEndpoint(stack, 'api-gateway-sagemakerendpoint', { endpointName: 'my-endpoint', resourcePath: '{my_param}', requestMappingTemplate: 'my-request-vtl-template' }); expect(pattern.apiGateway !== null); expect(pattern.apiGatewayRole !== null); expect(pattern.apiGatewayCloudWatchRole !== null); expect(pattern.apiGatewayLogGroup !== null); }
Nexuscompute/aws-solutions-constructs
source/patterns/@aws-solutions-constructs/aws-apigateway-sagemakerendpoint/test/apigateway-sagemakerendpoint.test.ts
TypeScript
ArrowFunction
() => { const stack = new Stack(); const existingRole = new iam.Role(stack, 'api-gateway-role', { assumedBy: new iam.ServicePrincipal('apigateway.amazonaws.com'), description: 'existing role for SageMaker integration', inlinePolicies: { InvokePolicy: new iam.PolicyDocument({ statements: [new iam.PolicyStatement({ resources: [`arn:${Aws.PARTITION}:sagemaker:${Aws.REGION}:${Aws.ACCOUNT_ID}:endpoint/my-endpoint`], actions: ['sagemaker:InvokeEndpoint'] })] }) } }); new ApiGatewayToSageMakerEndpoint(stack, 'api-gateway-sagemakerendpoint', { endpointName: 'my-endpoint', resourcePath: '{my_param}', requestMappingTemplate: 'my-request-vtl-template', apiGatewayProps: { restApiName: 'my-api', deployOptions: { methodOptions: { '/*/*': { throttlingRateLimit: 100, throttlingBurstLimit: 25 } } } }, apiGatewayExecutionRole: existingRole, resourceName: 'my-resource', responseMappingTemplate: 'my-response-vtl-template' }); expect(stack).toHaveResourceLike('AWS::ApiGateway::Stage', { MethodSettings: [ { DataTraceEnabled: false, HttpMethod: '*', LoggingLevel: 'INFO', ResourcePath: '/*' }, { HttpMethod: '*', ResourcePath: '/*', ThrottlingRateLimit: 100, ThrottlingBurstLimit: 25 } ] }); expect(stack).toHaveResourceLike('AWS::ApiGateway::Resource', { PathPart: 'my-resource' }); expect(stack).toHaveResourceLike('AWS::ApiGateway::Method', { Integration: { IntegrationResponses: [ { ResponseTemplates: { 'application/json': 'my-response-vtl-template', }, StatusCode: '200' }, { StatusCode: '500', SelectionPattern: '5\\d{2}' }, { StatusCode: '400', SelectionPattern: '4\\d{2}' } ] }, MethodResponses: [ { StatusCode: '200' }, { StatusCode: '500' }, { StatusCode: '400' } ] }); expect(stack).toHaveResourceLike('AWS::IAM::Role', { Description: 'existing role for SageMaker integration' }); }
Nexuscompute/aws-solutions-constructs
source/patterns/@aws-solutions-constructs/aws-apigateway-sagemakerendpoint/test/apigateway-sagemakerendpoint.test.ts
TypeScript
ArrowFunction
() => async (dispatch: Dispatch<FarmAction>, getState: () => RootState): Promise<void> => { const { accountPkh } = getState().wallet; try { // Retrieve boxes const _res = await axios.get(`${indexerAPI}/boxes?address=${accountPkh}`); const boxes: Box[] = []; // Iterate and assign stages for (const box of _res.data) { boxes.push({ key: box.key, ...findStage(parseInt(box.timesWatered), box.lastWatered), }); } dispatch({ type: t.FarmActionTypes.LOAD_BOXES, payload: boxes, }); } catch (err) { console.error(err); } }
AnshuJalan/box-defi
dapp/src/redux/action-creators/farm.ts
TypeScript
ArrowFunction
async (dispatch: Dispatch<FarmAction>, getState: () => RootState): Promise<void> => { const { accountPkh } = getState().wallet; try { // Retrieve boxes const _res = await axios.get(`${indexerAPI}/boxes?address=${accountPkh}`); const boxes: Box[] = []; // Iterate and assign stages for (const box of _res.data) { boxes.push({ key: box.key, ...findStage(parseInt(box.timesWatered), box.lastWatered), }); } dispatch({ type: t.FarmActionTypes.LOAD_BOXES, payload: boxes, }); } catch (err) { console.error(err); } }
AnshuJalan/box-defi
dapp/src/redux/action-creators/farm.ts
TypeScript
ArrowFunction
( timesWatered: number, lastWatered: string ): { stage: BoxStage; needsWater: boolean; waterBy: number } => { const notWateredIn = Date.now() - new Date(lastWatered).getTime(); if (notWateredIn > 2 * waterPeriod && timesWatered !== 5) return { stage: BoxStage.DEAD, waterBy: 0, needsWater: false }; else { return { waterBy: 2 * waterPeriod - notWateredIn, needsWater: notWateredIn > waterPeriod, stage: notWateredIn > waterPeriod ? BoxStage[`STAGE_${timesWatered + 1}` as keyof typeof BoxStage] : BoxStage[`STAGE_${timesWatered}` as keyof typeof BoxStage], }; } }
AnshuJalan/box-defi
dapp/src/redux/action-creators/farm.ts
TypeScript
ArrowFunction
x => result[x] = Math.max(0, value[x])
M1Les/PowerBI-visuals
src/Clients/CustomVisuals/visuals/dotPlot/dotPlot.ts
TypeScript
ArrowFunction
() => visualMessage
M1Les/PowerBI-visuals
src/Clients/CustomVisuals/visuals/dotPlot/dotPlot.ts
TypeScript
ArrowFunction
(point: DotPlotDataPoint) => xScale(point.x) + xScale.rangeBand() / 2
M1Les/PowerBI-visuals
src/Clients/CustomVisuals/visuals/dotPlot/dotPlot.ts
TypeScript
ArrowFunction
(point: DotPlotDataPoint) => yScale(point.y)
M1Les/PowerBI-visuals
src/Clients/CustomVisuals/visuals/dotPlot/dotPlot.ts
TypeScript
ArrowFunction
d => d.color
M1Les/PowerBI-visuals
src/Clients/CustomVisuals/visuals/dotPlot/dotPlot.ts
TypeScript
ArrowFunction
(data: DotPlotDataPoint) => { this.selectionManager .select(data.identity, d3.event.ctrlKey) .then((selectionIds: SelectionId[]) => this.setSelection(dotSelection, selectionIds)); d3.event.stopPropagation(); }
M1Les/PowerBI-visuals
src/Clients/CustomVisuals/visuals/dotPlot/dotPlot.ts
TypeScript
ArrowFunction
(selectionIds: SelectionId[]) => this.setSelection(dotSelection, selectionIds)
M1Les/PowerBI-visuals
src/Clients/CustomVisuals/visuals/dotPlot/dotPlot.ts
TypeScript
ArrowFunction
() => { this.selectionManager.clear(); this.setSelection(dotSelection); }
M1Les/PowerBI-visuals
src/Clients/CustomVisuals/visuals/dotPlot/dotPlot.ts
TypeScript
ArrowFunction
(dotSelectionData: DotPlotDataPoint) => !selectionIds.some((selectionId: SelectionId) => dotSelectionData.identity === selectionId)
M1Les/PowerBI-visuals
src/Clients/CustomVisuals/visuals/dotPlot/dotPlot.ts
TypeScript