當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript typestore.FinderDescriptor函數代碼示例

本文整理匯總了TypeScript中typestore.FinderDescriptor函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript FinderDescriptor函數的具體用法?TypeScript FinderDescriptor怎麽用?TypeScript FinderDescriptor使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了FinderDescriptor函數的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1:

	@CloudSearchFinderDescriptor({
		resultType: Object,
		resultKeyMapper: DefaultKeyMapper<Object>('id')
	})
	@FinderDescriptor()
	findByTagLineFullText(text:string):Promise<Car[]> {
		return null
	}
開發者ID:densebrain,項目名稱:typestore,代碼行數:8,代碼來源:ExampleRunCarsNode.ts

示例2: fn

	@IndexedDBFinderDescriptor({
		async fn(repo,...args) {
			const {table,mapper,db} = repo
			const jsons = await table.where('name').equalsIgnoreCase(args[0]).toArray()
			return jsons.map(json => mapper.fromObject(json))
		}
	})
	@FinderDescriptor()
	findByName(name:string):Promise<IDBModel1[]> {
		return null
	}
開發者ID:densebrain,項目名稱:typestore,代碼行數:11,代碼來源:IndexDBTestModel.ts

示例3: filter

	@IndexedDBFinderDescriptor({
		filter(o,...args) {
			const txt = o.randomText || ""
			const q = args[0] || ''
			return txt.length > 0 &&
				txt.toLowerCase().indexOf(q.toLowerCase()) > -1
		}
	})
	@FinderDescriptor()
	findByRandomTest(text:string):Promise<IDBModel1[]> {
		return null
	}
開發者ID:densebrain,項目名稱:typestore,代碼行數:12,代碼來源:IndexDBTestModel.ts

示例4: function

	@DynamoDBFinderDescriptor({
		queryExpression: "randomText = :randomText",
		index: 'RandomTextIndex',
		// values could be ['randomText'] with the same effect
		values: function(...args) {
			return {
				':randomText': args[0]
			}
		}
	})
	@FinderDescriptor()
	findByRandomText(text:string):Promise<Test1[]> {
		return null
	}
開發者ID:densebrain,項目名稱:typestore,代碼行數:14,代碼來源:Test1.ts

示例5: function

	// This decoration must come before @FinderDescriptor
	// simply specifies details and options specifically for
	// Dynamo DB's finder implementation - any store/plugin
	// can still implement this, and have other decorations
	// as well
	@DynamoDBFinderDescriptor({
		queryExpression: "tagLine = :tagLine",
		index: 'TagLineIndex',
		// values could be ['tagLine'] with the same effect
		// values can be Array<string> or Function
		values: function(...args) {
			return {
				':tagLine': args[0]
			}
		}
	})
	// Mark it as a finder
	@FinderDescriptor()
	findByTagLine(text:string):Promise<Car[]> {
		//Empty implementation - it's implemented
		//when the repo is initialized - anything
		//in here is lost
		return null
	}
開發者ID:densebrain,項目名稱:typestore,代碼行數:24,代碼來源:ExampleRunCarsNode.ts

示例6: FinderDescriptor

	(opts:IPouchDBMangoFinderOptions) => FinderDescriptor(opts)
開發者ID:densebrain,項目名稱:typestore,代碼行數:1,代碼來源:PouchDBDecorations.ts


注:本文中的typestore.FinderDescriptor函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。